mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-21 23:05:59 +01:00
output child WEXITSTATUS/WTERMSIG on abnormal termination
This commit is contained in:
parent
3061ebd7e1
commit
e651f31642
1 changed files with 4 additions and 2 deletions
6
st.c
6
st.c
|
@ -738,8 +738,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue