diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-01 01:11:00 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-01 01:11:00 +0100 |
commit | cddd2f37e95ef87e47b06eeb83bf54a6454aebc1 (patch) | |
tree | 9b5eb5a3344fbe5f68eedae46948da8d547f7928 /Userland | |
parent | a685809e754005dca5dd8abc78b3de677bf64f8e (diff) | |
download | serenity-cddd2f37e95ef87e47b06eeb83bf54a6454aebc1.zip |
Have sh print out which signal terminated a child process.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/sh.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/sh.cpp b/Userland/sh.cpp index f218ae7290..264a748cf7 100644 --- a/Userland/sh.cpp +++ b/Userland/sh.cpp @@ -148,7 +148,11 @@ static int runcmd(char* cmd) if (WIFEXITED(wstatus)) { //printf("Exited normally with status %d\n", WEXITSTATUS(wstatus)); } else { - printf("Exited abnormally\n"); + if (WIFSIGNALED(wstatus)) { + printf("Terminated by signal %d\n", WTERMSIG(wstatus)); + } else { + printf("Exited abnormally\n"); + } } return retval; } |