Browse code

core: exit with failure code if a child dies

Camille Oudot authored on 19/11/2015 10:16:11
Showing 1 changed files
... ...
@@ -755,7 +755,11 @@ void handle_sigs(void)
755 755
 			/* exit */
756 756
 			shutdown_children(SIGTERM, 1);
757 757
 			LM_DBG("terminating due to SIGCHLD\n");
758
-			exit(0);
758
+			if (WIFSIGNALED(chld_status)) {
759
+				exit(1);
760
+			} else {
761
+				exit(0);
762
+			}
759 763
 			break;
760 764
 
761 765
 		case SIGHUP: /* ignoring it*/