mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::exec: Set signal mask for the child process.
This commit is contained in:
parent
f4558a84e6
commit
fea49e07df
1 changed files with 10 additions and 0 deletions
10
ircd/exec.cc
10
ircd/exec.cc
|
@ -338,6 +338,16 @@ const noexcept
|
|||
e->path,
|
||||
};
|
||||
#endif
|
||||
|
||||
// Ignore SIGINT/SIGQUIT that way the administrator striking ctrl-c or
|
||||
// ctrl-\ at the console doesn't terminate the child.
|
||||
#if defined(HAVE_SIGNAL_H)
|
||||
sigset_t ours;
|
||||
sys::call(sigemptyset, &ours);
|
||||
sys::call(sigaddset, &ours, SIGINT);
|
||||
sys::call(sigaddset, &ours, SIGQUIT);
|
||||
sys::call(sigprocmask, SIG_BLOCK, &ours, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class executor>
|
||||
|
|
Loading…
Reference in a new issue