aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-01-20 17:23:18 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-01-20 17:23:18 +0000
commit72654d84113c8b241028342b1b79d70220ff92bd (patch)
tree5978d3ecf0b313ceab12207ba8dcb399ceb13855
parentbacb71f1c3ed5f40e393afd8be81bedfba13a401 (diff)
parenteee9db9d115d91aa82f33685c4e76d656db92976 (diff)
downloadslirp-72654d84113c8b241028342b1b79d70220ff92bd.zip
slirp-72654d84113c8b241028342b1b79d70220ff92bd.tar.gz
slirp-72654d84113c8b241028342b1b79d70220ff92bd.tar.bz2
Merge branch 'master' into 'master'
fork_exec_child_setup: improve signal handling See merge request slirp/libslirp!61
-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
}