[sr-dev] git:4.3:c064b97f: core: exit with failure code if a child dies

Camille Oudot camille.oudot at orange.com
Thu Nov 19 12:44:02 CET 2015


Module: kamailio
Branch: 4.3
Commit: c064b97f79e4a4c757166704b67b98d36340d7cc
URL: https://github.com/kamailio/kamailio/commit/c064b97f79e4a4c757166704b67b98d36340d7cc

Author: Camille Oudot <camille.oudot at orange.com>
Committer: Camille Oudot <camille.oudot at orange.com>
Date: 2015-11-19T12:43:21+01:00

core: exit with failure code if a child dies

(cherry picked from commit dd7854ea6f7efa6899bf59bb0d5069f0daf1def9)

---

Modified: main.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c064b97f79e4a4c757166704b67b98d36340d7cc.diff
Patch: https://github.com/kamailio/kamailio/commit/c064b97f79e4a4c757166704b67b98d36340d7cc.patch

---

diff --git a/main.c b/main.c
index a990cf7..30519fb 100644
--- a/main.c
+++ b/main.c
@@ -745,7 +745,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*/




More information about the sr-dev mailing list