forked from enlightenment/efl
ecore_exe/efl_exe - implement exit with parent on bsds with procctl
This commit is contained in:
parent
77db0820e3
commit
72a8a2ce40
|
@ -97,6 +97,7 @@ function_checks = [
|
|||
['mmap', ['sys/mman.h']],
|
||||
['mtrace', ['mcheck.h']],
|
||||
['prctl', ['sys/prctl.h']],
|
||||
['procctl', ['sys/procctl.h']],
|
||||
['realpath', ['stdlib.h']],
|
||||
['setxattr', ['sys/types.h', 'sys/xattr.h']],
|
||||
['siglongjmp', ['setjmp.h']],
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
#ifdef HAVE_PRCTL
|
||||
# include <sys/prctl.h>
|
||||
#elif defined(HAVE_PROCCTL)
|
||||
# include <sys/procctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
|
@ -1000,6 +1002,12 @@ _ecore_exe_exec_it(const char *exe_cmd,
|
|||
{
|
||||
prctl(PR_SET_PDEATHSIG, SIGTERM);
|
||||
}
|
||||
#elif defined(HAVE_PROCCTL)
|
||||
if ((flags & ECORE_EXE_TERM_WITH_PARENT))
|
||||
{
|
||||
int sig = SIGTERM;
|
||||
procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(flags & ECORE_EXE_NOT_LEADER)) setsid();
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
# include <sys/socket.h>
|
||||
# ifdef HAVE_PRCTL
|
||||
# include <sys/prctl.h>
|
||||
# elif defined(HAVE_PROCCTL)
|
||||
# include <sys/procctl.h>
|
||||
# endif
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
|
@ -150,6 +152,12 @@ _exec(const char *cmd, Efl_Exe_Flags flags, Efl_Task_Flags task_flags)
|
|||
# ifdef HAVE_PRCTL
|
||||
if (task_flags & EFL_TASK_FLAGS_EXIT_WITH_PARENT)
|
||||
prctl(PR_SET_PDEATHSIG, SIGTERM);
|
||||
#elif defined(HAVE_PROCCTL)
|
||||
if (task_flags & EFL_TASK_FLAGS_EXIT_WITH_PARENT)
|
||||
{
|
||||
int sig = SIGTERM;
|
||||
procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (flags & EFL_EXE_FLAGS_GROUP_LEADER) setsid();
|
||||
|
|
Loading…
Reference in New Issue