diff options
-rw-r--r-- | extrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/extrace.c b/extrace.c index 48c2a41..531f1e9 100644 --- a/extrace.c +++ b/extrace.c @@ -364,12 +364,12 @@ handle_msg(struct cn_msg *cn_hdr) fprintf(output, "%d- ", pid); print_shquoted(pid_db[i].cmdline); - if (ev->event_data.exit.exit_code & 0x7f) + if (!WIFEXITED(ev->event_data.exit.exit_code)) fprintf(output, " exited signal=%s", - sig2name(ev->event_data.exit.exit_code)); + sig2name(WTERMSIG(ev->event_data.exit.exit_code))); else fprintf(output, " exited status=%d", - ev->event_data.exit.exit_code >> 8); + WEXITSTATUS(ev->event_data.exit.exit_code)); fprintf(output, " time=%.3f\n", (ev->timestamp_ns - pid_db[i].start) / 1e9 ); fflush(output); |