zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=043a2c90ff5f56abcb39c382af85f6bd3019f6fc
commit 043a2c90ff5f56abcb39c382af85f6bd3019f6fc Author: Mike Blumenkrantz <[email protected]> Date: Thu Mar 12 12:15:34 2020 -0400 efl/exe: add term_with_parent flag Summary: same as ecore_exe Depends on D11451 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11465 --- src/lib/ecore/efl_exe.c | 13 ++++++++++++- src/lib/ecore/efl_exe.eo | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 4580a41351..1cb0276205 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -552,7 +552,18 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd) int except[2] = { 0, -1 }; except[0] = pd->fd.exited_write; eina_file_close_from(3, except); - +#ifdef HAVE_PRCTL + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { + prctl(PR_SET_PDEATHSIG, SIGTERM); + } +#elif defined(HAVE_PROCCTL) + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { + int sig = SIGTERM; + procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig); + } +#endif // actually execute! _exec(cmd, pd->flags, td->flags); // we couldn't exec... uh oh. HAAAAAAAALP! diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 11f6519be3..c4cc2d7ebf 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -18,7 +18,8 @@ enum @beta Efl.Exe_Flags { [[Flags to customize process behavior.]] none = 0, [[No special flags.]] group_leader = 1, [[Process will be executed in its own session.]] - hide_io = 4 [[All console IO will be hidden.]] + hide_io = 4, [[All console IO will be hidden.]] + term_with_parent = 8, [[Makes child receive SIGTERM when parent dies.]] } class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line --
