commit - d7bf023b2f2d41cb6983bb3ce2c6d1bf049150b3
commit + 096b125db7ec254002a049ef3a5c1204bd7f0ad9
blob - a51d19c61b1210bd35a482a8a05002961ef100cd
blob + b8e607714d2b87863ac4e8ef3b3b68164e1c6ebd
--- st.c
+++ st.c
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);
}