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 94b6cfb24c
commit d31fca2089
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,10 @@
#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
}
}