Browse Source

core: exit with failure code if a child dies

Camille Oudot 9 years ago
parent
commit
dd7854ea6f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      main.c

+ 5 - 1
main.c

@@ -755,7 +755,11 @@ void handle_sigs(void)
 			/* exit */
 			shutdown_children(SIGTERM, 1);
 			LM_DBG("terminating due to SIGCHLD\n");
-			exit(0);
+			if (WIFSIGNALED(chld_status)) {
+				exit(1);
+			} else {
+				exit(0);
+			}
 			break;
 
 		case SIGHUP: /* ignoring it*/