X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/b4d68d4daa2716c0064605a2a92082a7287ee54a..7e19e116764d2651721cb9062ccaac31b0c771f2:/st.c 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) 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); }