mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
xwayland: Reset signal mask and handlers before exec
Certain signal-related properties, such as the signal mask and handlers that are set to ignore, are not reset by exec and therefore affect the new process image. In case of Xwayland, a compositor setting SIGCHLD to SIG_IGN causes keyboard compilation to fail as it expects waitpid to work by default. Reset the signal mask and the two signals that sway is known to set.
This commit is contained in:
parent
50edd3a42d
commit
954dba3968
1 changed files with 7 additions and 0 deletions
|
|
@ -36,6 +36,13 @@ noreturn static void exec_xwayland(struct wlr_xwayland_server *server,
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The compositor may have messed with signal handling, try to clean it up
|
||||||
|
sigset_t set;
|
||||||
|
sigemptyset(&set);
|
||||||
|
sigprocmask(SIG_SETMASK, &set, NULL);
|
||||||
|
signal(SIGPIPE, SIG_DFL);
|
||||||
|
signal(SIGCHLD, SIG_DFL);
|
||||||
|
|
||||||
char *argv[64] = {0};
|
char *argv[64] = {0};
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue