Skip to content

Commit

Permalink
stats_t initialization
Browse files Browse the repository at this point in the history
- `do_interval_stats`: Initialize more `stats_t` structures
  • Loading branch information
jelu committed Feb 1, 2023
1 parent 8290775 commit 64b8c6d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/dnsperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,9 +1249,9 @@ static void*
do_interval_stats(void* arg)
{
threadinfo_t* tinfo;
stats_t total;
stats_t last;
stats_t diff = {};
stats_t total = {};
stats_t last = {};
stats_t diff = {};
uint64_t now;
uint64_t last_interval_time;
uint64_t interval_time;
Expand All @@ -1260,7 +1260,6 @@ do_interval_stats(void* arg)

tinfo = arg;
last_interval_time = tinfo->times->start_time;
memset(&last, 0, sizeof(last));

wait_for_start();
while (perf_os_waituntilreadable(&sock, threadpipe[0],
Expand Down Expand Up @@ -1539,7 +1538,7 @@ int main(int argc, char** argv)
perf_os_blocksignal(SIGINT, false);
sock.fd = mainpipe[0];
result = perf_os_waituntilreadable(&sock, intrpipe[0],
times.stop_time - times.start_time);
times.stop_time - times.start_time);
if (result == PERF_R_CANCELED)
interrupted = true;

Expand Down

0 comments on commit 64b8c6d

Please sign in to comment.