diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-08-20 00:49:29 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-08-20 00:49:29 +0200 |
commit | a8c6a88da9a89a7ed67ddb6771408e2db0510107 (patch) | |
tree | 302b1367efa35adc3ae124b288fa234ea90becbf /extrace.c | |
parent | 02536f177cb55079cb2df4febc2b04c9c9b5053f (diff) | |
download | extrace-a8c6a88da9a89a7ed67ddb6771408e2db0510107.tar.gz extrace-a8c6a88da9a89a7ed67ddb6771408e2db0510107.tar.xz extrace-a8c6a88da9a89a7ed67ddb6771408e2db0510107.zip |
use wait macros
Diffstat (limited to 'extrace.c')
-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); |