aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index e6bc0a2..12487b2 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -136,6 +136,14 @@ static void fork_exec_child_setup(gpointer data)
{
#ifndef _WIN32
setsid();
+
+ /* Unblock all signals and leave our exec()-ee to block what it wants */
+ sigset_t ss;
+ sigemptyset(&ss);
+ sigprocmask(SIG_SETMASK, &ss, NULL);
+
+ /* POSIX is obnoxious about SIGCHLD specifically across exec() */
+ signal(SIGCHLD, SIG_DFL);
#endif
}