mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -59,6 +64,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
OT_SETUP_RESET_JUMP(argv);
|
||||
|
||||
#ifdef __linux__
|
||||
// Ensure we terminate this process if the
|
||||
// parent process dies.
|
||||
prctl(PR_SET_PDEATHSIG, SIGHUP);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
size_t otInstanceBufferLength = 0;
|
||||
uint8_t *otInstanceBuffer = NULL;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <libgen.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
Reference in New Issue
Block a user