diff options
author | Clint Adams <clint@debian.org> | 2012-01-30 23:28:29 -0500 |
---|---|---|
committer | Clint Adams <clint@debian.org> | 2012-01-30 23:28:29 -0500 |
commit | 7c15b5a53340858d89d43d59c992ef26fa83005e (patch) | |
tree | dc4899be8a25265211e98fe8c35ece1b1290cfcf | |
parent | 257ed8d11e8eef852606482b1d5138cb9b8af7f9 (diff) | |
download | debianutils-7c15b5a53340858d89d43d59c992ef26fa83005e.tar.gz |
Patch from Daniel Richman to unblock SIGCHLD before spawning. closes: #657947.
-rw-r--r-- | run-parts.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/run-parts.c b/run-parts.c index b2835d6..b84d186 100644 --- a/run-parts.c +++ b/run-parts.c @@ -51,6 +51,9 @@ char **args = 0; char *custom_ere; regex_t hierre, tradre, excsre, classicalre, customre; +static void catch_signals(); +static void restore_signals(); + static char* regex_get_error(int errcode, regex_t *compiled); static void regex_compile_pattern(void); static void regex_clean(void); @@ -178,6 +181,7 @@ void run_part(char *progname) exit(1); } else if (!pid) { + restore_signals(); if (new_session_mode) setsid(); if (report_mode) { @@ -347,6 +351,15 @@ static void catch_signals() sigprocmask(SIG_BLOCK, &set, NULL); } +/* Unblock signals before execing a child */ +static void restore_signals() +{ + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGCHLD); + sigprocmask(SIG_UNBLOCK, &set, NULL); +} + /* Find the parts to run & call run_part() */ void run_parts(char *dirname) { |