mirror of
https://github.com/espressif/openthread.git
synced 2026-10-18 21:48:12 +00:00
[simulation] SIGHUP when parent dies (#9624)
This commit is contained in:
@@ -27,6 +27,11 @@
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#ifdef __linux__
|
||||
#include <signal.h>
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
|
||||
@@ -97,6 +102,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
otInstance *instance;
|
||||
|
||||
#ifdef __linux__
|
||||
// Ensure we terminate this process if the
|
||||
// parent process dies.
|
||||
prctl(PR_SET_PDEATHSIG, SIGHUP);
|
||||
#endif
|
||||
|
||||
OT_SETUP_RESET_JUMP(argv);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user