mirror of
https://github.com/swaywm/sway.git
synced 2026-04-21 06:46:22 -04:00
Use SIG_IGN for SIGCHLD instead of our own handler
The behavior of handlers registered with signal(3p) is not well-defined for signals delivered more than once, as laid out in the man page. We should replace our use of signal with sigaction, but for SIGCHLD specifically we can also just skip the signals altogether by setting the handler to SIG_IGN which causes child reaping to not be required. Fixes: https://github.com/swaywm/sway/pull/8567
This commit is contained in:
parent
5d7b9a8320
commit
8238e5242b
4 changed files with 14 additions and 18 deletions
|
|
@ -52,11 +52,8 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
|
|||
pid_t child = fork();
|
||||
if (child == 0) {
|
||||
restore_nofile_limit();
|
||||
restore_signals();
|
||||
setsid();
|
||||
sigset_t set;
|
||||
sigemptyset(&set);
|
||||
sigprocmask(SIG_SETMASK, &set, NULL);
|
||||
signal(SIGPIPE, SIG_DFL);
|
||||
|
||||
if (ctx) {
|
||||
const char *token = launcher_ctx_get_token_name(ctx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue