Cage: reset signal mask after forking

Cage uses wl_event_loop_add_signal to handle SIGINT and SIGTERM, which
masks these signals. This means that the subprocess spawned by Cage
start with these signals masked, which can lead to delays in Cage
shutting down on e.g. ^C. Hence, we now unmask all signals between fork
and exec.

Fixes #40
This commit is contained in:
Jente Hidskes 2019-02-17 21:14:31 +01:00
parent 76e8be14d9
commit 996f641cf0
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

3
cage.c
View file

@ -48,6 +48,9 @@ spawn_primary_client(char *argv[], pid_t *pid_out)
{
pid_t pid = fork();
if (pid == 0) {
sigset_t set;
sigemptyset(&set);
sigprocmask(SIG_SETMASK, &set, NULL);
execvp(argv[0], argv);
_exit(1);
} else if (pid == -1) {