diff options
author | Lauri Tirkkonen <lotheac@iki.fi> | 2018-12-11 11:43:03 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-12-11 18:36:02 +0100 |
commit | 096b125db7ec254002a049ef3a5c1204bd7f0ad9 (patch) | |
tree | 7372291cf5b13ed430d9de0637e1ee58b9bbdb7e /st.c | |
parent | d7bf023b2f2d41cb6983bb3ce2c6d1bf049150b3 (diff) |
output child WEXITSTATUS/WTERMSIG on abnormal termination
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -731,8 +731,10 @@ sigchld(int a) if (pid != p) return; - if (!WIFEXITED(stat) || WEXITSTATUS(stat)) - die("child finished with error '%d'\n", stat); + if (WIFEXITED(stat) && WEXITSTATUS(stat)) + die("child exited with status %d\n", WEXITSTATUS(stat)); + else if (WIFSIGNALED(stat)) + die("child terminated due to signal %d\n", WTERMSIG(stat)); exit(0); } |