pinosaur
/
st.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7bf023
)
output child WEXITSTATUS/WTERMSIG on abnormal termination
author
Lauri Tirkkonen
<lotheac@iki.fi>
Tue, 11 Dec 2018 09:43:03 +0000
(11:43 +0200)
committer
Hiltjo Posthuma
<hiltjo@codemadness.org>
Tue, 11 Dec 2018 17:36:02 +0000
(18:36 +0100)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
a51d19c
..
b8e6077
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-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);
}