Skip to content

Commit

Permalink
Shell: When a command is terminated by a signal, print signal descrip…
Browse files Browse the repository at this point in the history
…tion.

Previously we were only printing the signal number (except for SIGINT.)
  • Loading branch information
awesomekling committed May 26, 2019
1 parent 7c37ffd commit 0fa0988
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,7 @@ static int run_command(const String& cmd)
return WEXITSTATUS(wstatus);
} else {
if (WIFSIGNALED(wstatus)) {
switch (WTERMSIG(wstatus)) {
case SIGINT:
printf("Interrupted\n");
break;
default:
printf("Terminated by signal %d\n", WTERMSIG(wstatus));
break;
}
puts(strsignal(WTERMSIG(wstatus)));
} else {
printf("Exited abnormally\n");
return 1;
Expand Down

0 comments on commit 0fa0988

Please sign in to comment.