]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Kill FS if -reincarnate parent dies unexpectedly
authorTravis Cross <tc@traviscross.com>
Fri, 26 Jul 2013 03:53:34 +0000 (03:53 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 26 Jul 2013 17:30:05 +0000 (17:30 +0000)
This only works on Linux.

src/switch.c

index 2a68db473c3432704b01f8f39c992cb41c888d9d..6ae8e584dbe034add4e366deb7813afc54489189 100644 (file)
 #endif
 #endif
 
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
+
 #include <switch.h>
 #include <switch_version.h>
 #include "private/switch_core_pvt.h"
@@ -397,6 +401,10 @@ static void reincarnate_protect(char **argv) {
                        } else goto refork;
                }
                goto rewait;
+       } else { /* child */
+#ifdef __linux__
+               prctl(PR_SET_PDEATHSIG, SIGTERM);
+#endif
        }
 }