cleanup() has exactly two call sites, die() and terminate(), and the
first one resets cflag in order to prevent call_summary() invocation.
Move the call to terminate() in order to avoid bogus cflag reset.
* strace.c (die): Remove cflag reset.
(cleanup): Move call_summary() call ...
(terminate): ... here.
die(void)
{
if (strace_tracer_pid == getpid()) {
- cflag = 0;
cleanup();
exit(1);
}
}
detach(tcp);
}
- if (cflag)
- call_summary(shared_log);
}
static void
terminate(void)
{
cleanup();
+ if (cflag)
+ call_summary(shared_log);
fflush(NULL);
if (shared_log != stderr)
fclose(shared_log);