Commit c8aa3758 authored by Ondřej Surý's avatar Ondřej Surý

Replace custom isc_boolean_t with C standard bool type

parent 1354fbf6
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
#include <fcntl.h> #include <fcntl.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -38,14 +39,14 @@ struct perf_datafile { ...@@ -38,14 +39,14 @@ struct perf_datafile {
pthread_mutex_t lock; pthread_mutex_t lock;
int pipe_fd; int pipe_fd;
int fd; int fd;
isc_boolean_t is_file; bool is_file;
size_t size; size_t size;
isc_boolean_t cached; bool cached;
char databuf[BUFFER_SIZE + 1]; char databuf[BUFFER_SIZE + 1];
isc_buffer_t data; isc_buffer_t data;
unsigned int maxruns; unsigned int maxruns;
unsigned int nruns; unsigned int nruns;
isc_boolean_t read_any; bool read_any;
}; };
static inline void static inline void
...@@ -70,12 +71,12 @@ perf_datafile_open(isc_mem_t *mctx, const char *filename) ...@@ -70,12 +71,12 @@ perf_datafile_open(isc_mem_t *mctx, const char *filename)
dfile->mctx = mctx; dfile->mctx = mctx;
MUTEX_INIT(&dfile->lock); MUTEX_INIT(&dfile->lock);
dfile->pipe_fd = -1; dfile->pipe_fd = -1;
dfile->is_file = ISC_FALSE; dfile->is_file = false;
dfile->size = 0; dfile->size = 0;
dfile->cached = ISC_FALSE; dfile->cached = false;
dfile->maxruns = 1; dfile->maxruns = 1;
dfile->nruns = 0; dfile->nruns = 0;
dfile->read_any = ISC_FALSE; dfile->read_any = false;
isc_buffer_init(&dfile->data, dfile->databuf, BUFFER_SIZE); isc_buffer_init(&dfile->data, dfile->databuf, BUFFER_SIZE);
if (filename == NULL) { if (filename == NULL) {
dfile->fd = STDIN_FILENO; dfile->fd = STDIN_FILENO;
...@@ -84,7 +85,7 @@ perf_datafile_open(isc_mem_t *mctx, const char *filename) ...@@ -84,7 +85,7 @@ perf_datafile_open(isc_mem_t *mctx, const char *filename)
if (dfile->fd < 0) if (dfile->fd < 0)
perf_log_fatal("unable to open file: %s", filename); perf_log_fatal("unable to open file: %s", filename);
if (fstat(dfile->fd, &buf) == 0 && S_ISREG(buf.st_mode)) { if (fstat(dfile->fd, &buf) == 0 && S_ISREG(buf.st_mode)) {
dfile->is_file = ISC_TRUE; dfile->is_file = true;
dfile->size = buf.st_size; dfile->size = buf.st_size;
} }
} }
...@@ -162,7 +163,7 @@ read_more(perf_datafile_t *dfile) ...@@ -162,7 +163,7 @@ read_more(perf_datafile_t *dfile)
if (dfile->is_file && if (dfile->is_file &&
isc_buffer_usedlength(&dfile->data) == dfile->size) isc_buffer_usedlength(&dfile->data) == dfile->size)
dfile->cached = ISC_TRUE; dfile->cached = true;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
...@@ -174,7 +175,7 @@ read_one_line(perf_datafile_t *dfile, isc_buffer_t *lines) ...@@ -174,7 +175,7 @@ read_one_line(perf_datafile_t *dfile, isc_buffer_t *lines)
unsigned int length, curlen, nrem; unsigned int length, curlen, nrem;
isc_result_t result; isc_result_t result;
while (ISC_TRUE) { while (true) {
/* Get the current line */ /* Get the current line */
cur = isc_buffer_current(&dfile->data); cur = isc_buffer_current(&dfile->data);
curlen = strcspn(cur, "\n"); curlen = strcspn(cur, "\n");
...@@ -219,7 +220,7 @@ read_one_line(perf_datafile_t *dfile, isc_buffer_t *lines) ...@@ -219,7 +220,7 @@ read_one_line(perf_datafile_t *dfile, isc_buffer_t *lines)
isc_result_t isc_result_t
perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines, perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines,
isc_boolean_t is_update) bool is_update)
{ {
const char *current; const char *current;
isc_result_t result; isc_result_t result;
...@@ -246,10 +247,10 @@ perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines, ...@@ -246,10 +247,10 @@ perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines,
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
goto done; goto done;
} }
dfile->read_any = ISC_TRUE; dfile->read_any = true;
if (is_update) { if (is_update) {
while (ISC_TRUE) { while (true) {
current = isc_buffer_used(lines); current = isc_buffer_used(lines);
result = read_one_line(dfile, lines); result = read_one_line(dfile, lines);
if (result == ISC_R_EOF && if (result == ISC_R_EOF &&
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#ifndef PERF_DATAFILE_H #ifndef PERF_DATAFILE_H
#define PERF_DATAFILE_H 1 #define PERF_DATAFILE_H 1
#include <stdbool.h>
#include <isc/types.h> #include <isc/types.h>
typedef struct perf_datafile perf_datafile_t; typedef struct perf_datafile perf_datafile_t;
...@@ -36,7 +38,7 @@ perf_datafile_setpipefd(perf_datafile_t *dfile, int pipe_fd); ...@@ -36,7 +38,7 @@ perf_datafile_setpipefd(perf_datafile_t *dfile, int pipe_fd);
isc_result_t isc_result_t
perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines, perf_datafile_next(perf_datafile_t *dfile, isc_buffer_t *lines,
isc_boolean_t is_update); bool is_update);
unsigned int unsigned int
perf_datafile_nruns(const perf_datafile_t *dfile); perf_datafile_nruns(const perf_datafile_t *dfile);
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -119,7 +120,7 @@ struct perf_dnsctx { ...@@ -119,7 +120,7 @@ struct perf_dnsctx {
}; };
perf_dnsctx_t * perf_dnsctx_t *
perf_dns_createctx(isc_boolean_t updates) perf_dns_createctx(bool updates)
{ {
isc_mem_t *mctx; isc_mem_t *mctx;
perf_dnsctx_t *ctx; perf_dnsctx_t *ctx;
...@@ -300,7 +301,7 @@ perf_dns_destroytsigkey(perf_dnstsigkey_t **tsigkeyp) ...@@ -300,7 +301,7 @@ perf_dns_destroytsigkey(perf_dnstsigkey_t **tsigkeyp)
* Appends an OPT record to the packet. * Appends an OPT record to the packet.
*/ */
static isc_result_t static isc_result_t
add_edns(isc_buffer_t *packet, isc_boolean_t dnssec) { add_edns(isc_buffer_t *packet, bool dnssec) {
unsigned char *base; unsigned char *base;
if (isc_buffer_availablelength(packet) < EDNSLEN) { if (isc_buffer_availablelength(packet) < EDNSLEN) {
...@@ -523,7 +524,7 @@ build_query(const isc_textregion_t *line, isc_buffer_t *msg) ...@@ -523,7 +524,7 @@ build_query(const isc_textregion_t *line, isc_buffer_t *msg)
return ISC_R_SUCCESS; return ISC_R_SUCCESS;
} }
static isc_boolean_t static bool
token_equals(const isc_textregion_t *token, const char *str) token_equals(const isc_textregion_t *token, const char *str)
{ {
return (strlen(str) == token->length && return (strlen(str) == token->length &&
...@@ -643,7 +644,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record, ...@@ -643,7 +644,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record,
unsigned char rdataarray[MAX_RDATA_LENGTH]; unsigned char rdataarray[MAX_RDATA_LENGTH];
isc_textregion_t token; isc_textregion_t token;
char *str; char *str;
isc_boolean_t is_update; bool is_update;
int updates = 0; int updates = 0;
int prereqs = 0; int prereqs = 0;
dns_fixedname_t fzname, foname; dns_fixedname_t fzname, foname;
...@@ -683,7 +684,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record, ...@@ -683,7 +684,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record,
isc_buffer_putuint16(msg, dns_rdatatype_soa); isc_buffer_putuint16(msg, dns_rdatatype_soa);
isc_buffer_putuint16(msg, dns_rdataclass_in); isc_buffer_putuint16(msg, dns_rdataclass_in);
while (ISC_TRUE) { while (true) {
input.base += strlen(input.base) + 1; input.base += strlen(input.base) + 1;
if (input.base >= record->base + record->length) { if (input.base >= record->base + record->length) {
perf_log_warning("warning: incomplete update"); perf_log_warning("warning: incomplete update");
...@@ -696,7 +697,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record, ...@@ -696,7 +697,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record,
dns_rdata_init(&rdata); dns_rdata_init(&rdata);
rdlen = 0; rdlen = 0;
rdclass = dns_rdataclass_in; rdclass = dns_rdataclass_in;
is_update = ISC_FALSE; is_update = false;
token.base = input.base; token.base = input.base;
token.length = strcspn(token.base, WHITESPACE); token.length = strcspn(token.base, WHITESPACE);
...@@ -705,42 +706,42 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record, ...@@ -705,42 +706,42 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record,
break; break;
} else if (token_equals(&token, "add")) { } else if (token_equals(&token, "add")) {
result = read_update_line(ctx, &input, str, zname, result = read_update_line(ctx, &input, str, zname,
ISC_TRUE, true,
ISC_TRUE, ISC_TRUE, ISC_TRUE, true, true, true,
oname, &ttl, &rdtype, oname, &ttl, &rdtype,
&rdata, &rdatabuf); &rdata, &rdatabuf);
rdclass = dns_rdataclass_in; rdclass = dns_rdataclass_in;
is_update = ISC_TRUE; is_update = true;
} else if (token_equals(&token, "delete")) { } else if (token_equals(&token, "delete")) {
result = read_update_line(ctx, &input, str, zname, result = read_update_line(ctx, &input, str, zname,
ISC_FALSE, false,
ISC_FALSE, ISC_TRUE, false, true,
ISC_FALSE, oname, &ttl, false, oname, &ttl,
&rdtype, &rdata, &rdatabuf); &rdtype, &rdata, &rdatabuf);
if (isc_buffer_usedlength(&rdatabuf) > 0) if (isc_buffer_usedlength(&rdatabuf) > 0)
rdclass = dns_rdataclass_none; rdclass = dns_rdataclass_none;
else else
rdclass = dns_rdataclass_any; rdclass = dns_rdataclass_any;
is_update = ISC_TRUE; is_update = true;
} else if (token_equals(&token, "require")) { } else if (token_equals(&token, "require")) {
result = read_update_line(ctx, &input, str, zname, result = read_update_line(ctx, &input, str, zname,
ISC_FALSE, false,
ISC_FALSE, ISC_TRUE, false, true,
ISC_FALSE, oname, &ttl, false, oname, &ttl,
&rdtype, &rdata, &rdatabuf); &rdtype, &rdata, &rdatabuf);
if (isc_buffer_usedlength(&rdatabuf) > 0) if (isc_buffer_usedlength(&rdatabuf) > 0)
rdclass = dns_rdataclass_in; rdclass = dns_rdataclass_in;
else else
rdclass = dns_rdataclass_any; rdclass = dns_rdataclass_any;
is_update = ISC_FALSE; is_update = false;
} else if (token_equals(&token, "prohibit")) { } else if (token_equals(&token, "prohibit")) {
result = read_update_line(ctx, &input, str, zname, result = read_update_line(ctx, &input, str, zname,
ISC_FALSE, false,
ISC_FALSE, ISC_FALSE, false, false,
ISC_FALSE, oname, &ttl, false, oname, &ttl,
&rdtype, &rdata, &rdatabuf); &rdtype, &rdata, &rdatabuf);
rdclass = dns_rdataclass_none; rdclass = dns_rdataclass_none;
is_update = ISC_FALSE; is_update = false;
} else { } else {
perf_log_warning("invalid update command: %s", perf_log_warning("invalid update command: %s",
input.base); input.base);
...@@ -803,7 +804,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record, ...@@ -803,7 +804,7 @@ build_update(perf_dnsctx_t *ctx, const isc_textregion_t *record,
isc_result_t isc_result_t
perf_dns_buildrequest(perf_dnsctx_t *ctx, const isc_textregion_t *record, perf_dns_buildrequest(perf_dnsctx_t *ctx, const isc_textregion_t *record,
uint16_t qid, uint16_t qid,
isc_boolean_t edns, isc_boolean_t dnssec, bool edns, bool dnssec,
perf_dnstsigkey_t *tsigkey, isc_buffer_t *msg) perf_dnstsigkey_t *tsigkey, isc_buffer_t *msg)
{ {
unsigned int flags; unsigned int flags;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
*/ */
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h>
#include <isc/types.h> #include <isc/types.h>
...@@ -54,7 +55,7 @@ void ...@@ -54,7 +55,7 @@ void
perf_dns_destroytsigkey(perf_dnstsigkey_t **tsigkeyp); perf_dns_destroytsigkey(perf_dnstsigkey_t **tsigkeyp);
perf_dnsctx_t * perf_dnsctx_t *
perf_dns_createctx(isc_boolean_t updates); perf_dns_createctx(bool updates);
void void
perf_dns_destroyctx(perf_dnsctx_t **ctxp); perf_dns_destroyctx(perf_dnsctx_t **ctxp);
...@@ -62,7 +63,7 @@ perf_dns_destroyctx(perf_dnsctx_t **ctxp); ...@@ -62,7 +63,7 @@ perf_dns_destroyctx(perf_dnsctx_t **ctxp);
isc_result_t isc_result_t
perf_dns_buildrequest(perf_dnsctx_t *ctx, const isc_textregion_t *record, perf_dns_buildrequest(perf_dnsctx_t *ctx, const isc_textregion_t *record,
uint16_t qid, uint16_t qid,
isc_boolean_t edns, isc_boolean_t dnssec, bool edns, bool dnssec,
perf_dnstsigkey_t *tsigkey, isc_buffer_t *msg); perf_dnstsigkey_t *tsigkey, isc_buffer_t *msg);
#endif #endif
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <math.h> #include <math.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -100,14 +101,14 @@ typedef struct { ...@@ -100,14 +101,14 @@ typedef struct {
isc_sockaddr_t local_addr; isc_sockaddr_t local_addr;
uint64_t timeout; uint64_t timeout;
uint32_t bufsize; uint32_t bufsize;
isc_boolean_t edns; bool edns;
isc_boolean_t dnssec; bool dnssec;
perf_dnstsigkey_t *tsigkey; perf_dnstsigkey_t *tsigkey;
uint32_t max_outstanding; uint32_t max_outstanding;
uint32_t max_qps; uint32_t max_qps;
uint64_t stats_interval; uint64_t stats_interval;
isc_boolean_t updates; bool updates;
isc_boolean_t verbose; bool verbose;
} config_t; } config_t;
typedef struct { typedef struct {
...@@ -167,7 +168,7 @@ typedef struct { ...@@ -167,7 +168,7 @@ typedef struct {
perf_dnsctx_t *dnsctx; perf_dnsctx_t *dnsctx;
isc_boolean_t done_sending; bool done_sending;
uint64_t done_send_time; uint64_t done_send_time;
const config_t *config; const config_t *config;
...@@ -184,9 +185,9 @@ static threadinfo_t *threads; ...@@ -184,9 +185,9 @@ static threadinfo_t *threads;
static pthread_mutex_t start_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t start_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t start_cond = PTHREAD_COND_INITIALIZER; static pthread_cond_t start_cond = PTHREAD_COND_INITIALIZER;
static isc_boolean_t started; static bool started;
static isc_boolean_t interrupted = ISC_FALSE; static bool interrupted = false;
static int threadpipe[2]; static int threadpipe[2];
static int mainpipe[2]; static int mainpipe[2];
...@@ -269,7 +270,7 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats) ...@@ -269,7 +270,7 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
{ {
const char *units; const char *units;
uint64_t run_time; uint64_t run_time;
isc_boolean_t first_rcode; bool first_rcode;
uint64_t latency_avg; uint64_t latency_avg;
unsigned int i; unsigned int i;
...@@ -296,12 +297,12 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats) ...@@ -296,12 +297,12 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
printf("\n"); printf("\n");
printf(" Response codes: "); printf(" Response codes: ");
first_rcode = ISC_TRUE; first_rcode = true;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
if (stats->rcodecounts[i] == 0) if (stats->rcodecounts[i] == 0)
continue; continue;
if (first_rcode) if (first_rcode)
first_rcode = ISC_FALSE; first_rcode = false;
else else
printf(", "); printf(", ");
printf("%s %" PRIu64 " (%.2lf%%)", printf("%s %" PRIu64 " (%.2lf%%)",
...@@ -481,7 +482,7 @@ setup(int argc, char **argv, config_t *config) ...@@ -481,7 +482,7 @@ setup(int argc, char **argv, config_t *config)
perf_datafile_setmaxruns(input, config->maxruns); perf_datafile_setmaxruns(input, config->maxruns);
if (config->dnssec) if (config->dnssec)
config->edns = ISC_TRUE; config->edns = true;
if (tsigkey != NULL) if (tsigkey != NULL)
config->tsigkey = perf_dns_parsetsigkey(tsigkey, mctx); config->tsigkey = perf_dns_parsetsigkey(tsigkey, mctx);
...@@ -683,7 +684,7 @@ do_send(void *arg) ...@@ -683,7 +684,7 @@ do_send(void *arg)
stats->total_request_size += length; stats->total_request_size += length;
} }
tinfo->done_send_time = get_time(); tinfo->done_send_time = get_time();
tinfo->done_sending = ISC_TRUE; tinfo->done_sending = true;
write(mainpipe[1], "", 1); write(mainpipe[1], "", 1);
return NULL; return NULL;
} }
...@@ -730,12 +731,12 @@ typedef struct { ...@@ -730,12 +731,12 @@ typedef struct {
unsigned int size; unsigned int size;
uint64_t when; uint64_t when;
uint64_t sent; uint64_t sent;
isc_boolean_t unexpected; bool unexpected;
isc_boolean_t short_response; bool short_response;
char *desc; char *desc;
} received_query_t; } received_query_t;
static isc_boolean_t static bool
recv_one(threadinfo_t *tinfo, int which_sock, recv_one(threadinfo_t *tinfo, int which_sock,
unsigned char *packet_buffer, unsigned int packet_size, unsigned char *packet_buffer, unsigned int packet_size,
received_query_t *recvd, int *saved_errnop) received_query_t *recvd, int *saved_errnop)
...@@ -752,7 +753,7 @@ recv_one(threadinfo_t *tinfo, int which_sock, ...@@ -752,7 +753,7 @@ recv_one(threadinfo_t *tinfo, int which_sock,
now = get_time(); now = get_time();
if (n < 0) { if (n < 0) {
*saved_errnop = errno; *saved_errnop = errno;
return ISC_FALSE; return false;
} }
recvd->sock = s; recvd->sock = s;
recvd->qid = ntohs(packet_header[0]); recvd->qid = ntohs(packet_header[0]);
...@@ -760,10 +761,10 @@ recv_one(threadinfo_t *tinfo, int which_sock, ...@@ -760,10 +761,10 @@ recv_one(threadinfo_t *tinfo, int which_sock,
recvd->size = n; recvd->size = n;
recvd->when = now; recvd->when = now;
recvd->sent = 0; recvd->sent = 0;
recvd->unexpected = ISC_FALSE; recvd->unexpected = false;
recvd->short_response = ISC_TF(n < 4); recvd->short_response = (n < 4);
recvd->desc = NULL; recvd->desc = NULL;
return ISC_TRUE; return true;
} }
static inline void static inline void
...@@ -777,7 +778,7 @@ bit_set(unsigned char *bits, unsigned int bit) ...@@ -777,7 +778,7 @@ bit_set(unsigned char *bits, unsigned int bit)
bits[bit / 8] |= mask; bits[bit / 8] |= mask;
} }
static inline isc_boolean_t static inline bool
bit_check(unsigned char *bits, unsigned int bit) bit_check(unsigned char *bits, unsigned int bit)
{ {
unsigned int shift; unsigned int shift;
...@@ -785,8 +786,8 @@ bit_check(unsigned char *bits, unsigned int bit) ...@@ -785,8 +786,8 @@ bit_check(unsigned char *bits, unsigned int bit)
shift = 7 - (bit % 8); shift = 7 - (bit % 8);
if ((bits[bit / 8] >> shift) & 0x01) if ((bits[bit / 8] >> shift) & 0x01)
return ISC_TRUE; return true;
return ISC_FALSE; return false;
} }
static void * static void *
...@@ -860,7 +861,7 @@ do_recv(void *arg) ...@@ -860,7 +861,7 @@ do_recv(void *arg)
q->timestamp == UINT64_MAX || q->timestamp == UINT64_MAX ||
q->sock != recvd[i].sock) q->sock != recvd[i].sock)
{ {
recvd[i].unexpected = ISC_TRUE; recvd[i].unexpected = true;
continue; continue;
} }
query_move(tinfo, q, append_unused); query_move(tinfo, q, append_unused);
...@@ -975,7 +976,7 @@ cancel_queries(threadinfo_t *tinfo) ...@@ -975,7 +976,7 @@ cancel_queries(threadinfo_t *tinfo)
{ {
struct query_info *q; struct query_info *q;
while (ISC_TRUE) { while (true) {
q = ISC_LIST_TAIL(tinfo->outstanding_queries); q = ISC_LIST_TAIL(tinfo->outstanding_queries);
if (q == NULL) if (q == NULL)
break; break;
...@@ -1108,7 +1109,7 @@ main(int argc, char **argv) ...@@ -1108,7 +1109,7 @@ main(int argc, char **argv)
perf_datafile_setpipefd(input, threadpipe[0]); perf_datafile_setpipefd(input, threadpipe[0]);
perf_os_blocksignal(SIGINT, ISC_TRUE); perf_os_blocksignal(SIGINT, true);
print_initial_status(&config); print_initial_status(&config);
...@@ -1132,16 +1133,16 @@ main(int argc, char **argv) ...@@ -1132,16 +1133,16 @@ main(int argc, char **argv)
times.stop_time_ns.tv_nsec = (times.stop_time % MILLION) * 1000; times.stop_time_ns.tv_nsec = (times.stop_time % MILLION) * 1000;
LOCK(&start_lock); LOCK(&start_lock);
started = ISC_TRUE; started = true;
BROADCAST(&start_cond); BROADCAST(&start_cond);
UNLOCK(&start_lock); UNLOCK(&start_lock);
perf_os_handlesignal(SIGINT, handle_sigint); perf_os_handlesignal(SIGINT, handle_sigint);
perf_os_blocksignal(SIGINT, ISC_FALSE); perf_os_blocksignal(SIGINT, false);
result = perf_os_waituntilreadable(mainpipe[0], intrpipe[0], result = perf_os_waituntilreadable(mainpipe[0], intrpipe[0],
times.stop_time - times.start_time); times.stop_time - times.start_time);
if (result == ISC_R_CANCELED) if (result == ISC_R_CANCELED)
interrupted = ISC_TRUE; interrupted = true;
times.end_time = get_time(); times.end_time = get_time();
......