Pārlūkot izejas kodu

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

Previously we were only printing the signal number (except for SIGINT.)
Andreas Kling 6 gadi atpakaļ
vecāks
revīzija
0fa098845f
1 mainītis faili ar 1 papildinājumiem un 8 dzēšanām
  1. 1 8
      Shell/main.cpp

+ 1 - 8
Shell/main.cpp

@@ -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)) {
-            case SIGINT:
-                printf("Interrupted\n");
-                break;
-            default:
-                printf("Terminated by signal %d\n", WTERMSIG(wstatus));
-                break;
-            }
+            puts(strsignal(WTERMSIG(wstatus)));
         } else {
         } else {
             printf("Exited abnormally\n");
             printf("Exited abnormally\n");
             return 1;
             return 1;