aboutsummaryrefslogtreecommitdiff
path: root/src/rc/runscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/runscript.c')
-rw-r--r--src/rc/runscript.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index e07cf588..f3f0517e 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -350,6 +350,8 @@ svc_exec(const char *arg1, const char *arg2)
size_t bytes;
bool prefixed = false;
int slave_tty;
+ sigset_t sigchldmask;
+ sigset_t oldmask;
/* Setup our signal pipe */
if (pipe(signal_pipe) == -1)
@@ -439,10 +441,17 @@ svc_exec(const char *arg1, const char *arg2)
}
free(buffer);
+
+ sigemptyset (&sigchldmask);
+ sigaddset (&sigchldmask, SIGCHLD);
+ sigprocmask (SIG_BLOCK, &sigchldmask, &oldmask);
+
close(signal_pipe[0]);
close(signal_pipe[1]);
signal_pipe[0] = signal_pipe[1] = -1;
+ sigprocmask (SIG_SETMASK, &oldmask, NULL);
+
if (master_tty >= 0) {
/* Why did we do this? */
/* signal (SIGWINCH, SIG_IGN); */