Kill FS if -reincarnate parent dies unexpectedly

This only works on Linux.
This commit is contained in:
Travis Cross 2013-07-26 03:53:34 +00:00
parent 9959096559
commit 1ab16bbd92

View File

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