From 1ab16bbd92b0634350ea5161e8071b4de7913b12 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 26 Jul 2013 03:53:34 +0000 Subject: [PATCH] Kill FS if -reincarnate parent dies unexpectedly This only works on Linux. --- src/switch.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/switch.c b/src/switch.c index 2a68db473c..6ae8e584db 100644 --- a/src/switch.c +++ b/src/switch.c @@ -44,6 +44,10 @@ #endif #endif +#ifdef __linux__ +#include +#endif + #include #include #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 } }