Shell: When a command is terminated by a signal, print signal description.

Previously we were only printing the signal number (except for SIGINT.)
This commit is contained in:
Andreas Kling 2019-05-26 02:07:03 +02:00
parent 7c37ffd9d8
commit 0fa098845f
Notes: sideshowbarker 2024-07-19 13:56:40 +09:00

View File

@ -405,14 +405,7 @@ static int run_command(const String& cmd)
return WEXITSTATUS(wstatus); return WEXITSTATUS(wstatus);
} else { } else {
if (WIFSIGNALED(wstatus)) { if (WIFSIGNALED(wstatus)) {
switch (WTERMSIG(wstatus)) { puts(strsignal(WTERMSIG(wstatus)));
case SIGINT:
printf("Interrupted\n");
break;
default:
printf("Terminated by signal %d\n", WTERMSIG(wstatus));
break;
}
} else { } else {
printf("Exited abnormally\n"); printf("Exited abnormally\n");
return 1; return 1;