Browse Source

core: exit with failure code if a child dies

Camille Oudot 9 năm trước cách đây
mục cha
commit
dd7854ea6f
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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*/