aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorLauri Tirkkonen <lotheac@iki.fi>2018-12-11 11:43:03 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-12-11 18:36:02 +0100
commit096b125db7ec254002a049ef3a5c1204bd7f0ad9 (patch)
tree7372291cf5b13ed430d9de0637e1ee58b9bbdb7e /st.c
parentd7bf023b2f2d41cb6983bb3ce2c6d1bf049150b3 (diff)
downloadst-096b125db7ec254002a049ef3a5c1204bd7f0ad9.tar.gz
st-096b125db7ec254002a049ef3a5c1204bd7f0ad9.zip
output child WEXITSTATUS/WTERMSIG on abnormal termination
Diffstat (limited to 'st.c')
-rw-r--r--st.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/st.c b/st.c
index a51d19c..b8e6077 100644
--- a/st.c
+++ b/st.c
@@ -731,8 +731,10 @@ sigchld(int a)
731 if (pid != p) 731 if (pid != p)
732 return; 732 return;
733 733
734 if (!WIFEXITED(stat) || WEXITSTATUS(stat)) 734 if (WIFEXITED(stat) && WEXITSTATUS(stat))
735 die("child finished with error '%d'\n", stat); 735 die("child exited with status %d\n", WEXITSTATUS(stat));
736 else if (WIFSIGNALED(stat))
737 die("child terminated due to signal %d\n", WTERMSIG(stat));
736 exit(0); 738 exit(0);
737} 739}
738 740