forked from Mirrors/flatpak-builder
helper: unblock SIGCHILD before execvp() of child
We don't want to block SIGCHILD from being handled by the child process, as that could be necessary for g_child_watch_add(), waitpid(), or similar.tingping/wmclass
parent
f83224c948
commit
f06a09b0f9
|
@ -1740,6 +1740,18 @@ block_sigchild (void)
|
|||
die_with_error ("sigprocmask");
|
||||
}
|
||||
|
||||
static void
|
||||
unblock_sigchild (void)
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
sigemptyset (&mask);
|
||||
sigaddset (&mask, SIGCHLD);
|
||||
|
||||
if (sigprocmask (SIG_UNBLOCK, &mask, NULL) == -1)
|
||||
die_with_error ("sigprocmask");
|
||||
}
|
||||
|
||||
static int
|
||||
close_extra_fds (void *data, int fd)
|
||||
{
|
||||
|
@ -2522,6 +2534,8 @@ main (int argc,
|
|||
if (sync_fd != -1)
|
||||
close (sync_fd);
|
||||
|
||||
unblock_sigchild ();
|
||||
|
||||
if (execvp (args[0], args) == -1)
|
||||
die_with_error ("execvp %s", args[0]);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue