fcc: report signals as errors when sdcc crashes
authorAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 00:47:46 +0000 (00:47 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 22 Nov 2017 00:47:46 +0000 (00:47 +0000)
Library/tools/fcc.c

index 369bece..671b2df 100644 (file)
@@ -359,6 +359,11 @@ static int do_command(void)
     default:
       while((w = wait(&status)) != pid);
   }
+  if (WIFSIGNALED(status)) {
+    fprintf(stderr, "%s exited with signal %s\n",
+      argvec[0], strsignal(WTERMSIG(status)));
+    return 255;
+  }
   return (WEXITSTATUS(status));
 }