summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen2002-07-03 05:15:23 +0000
committerEric Andersen2002-07-03 05:15:23 +0000
commit5222d31a15bce9d86b2d2781f75006f18df22865 (patch)
tree29cb674d7d16597c459799c118297a1bd6222257 /init
parent549df2ebc387b84914417b3f3742105f09f39130 (diff)
downloadbusybox-5222d31a15bce9d86b2d2781f75006f18df22865.zip
busybox-5222d31a15bce9d86b2d2781f75006f18df22865.tar.gz
Patch from till busch <buti@gmx.at> -- unblock all signals
in exec_signal() before calling exec()
Diffstat (limited to 'init')
-rw-r--r--init/init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index f109c4e..e481253 100644
--- a/init/init.c
+++ b/init/init.c
@@ -758,10 +758,26 @@ static void shutdown_system(void)
static void exec_signal(int sig)
{
struct init_action *a, *tmp;
+ sigset_t unblock_signals;
+
for (a = init_action_list; a; a = tmp) {
tmp = a->next;
if (a->action & RESTART) {
shutdown_system();
+
+ /* unblock all signals, blocked in shutdown_system() */
+ sigemptyset(&unblock_signals);
+ sigaddset(&unblock_signals, SIGHUP);
+ sigaddset(&unblock_signals, SIGCHLD);
+ sigaddset(&unblock_signals, SIGUSR1);
+ sigaddset(&unblock_signals, SIGUSR2);
+ sigaddset(&unblock_signals, SIGINT);
+ sigaddset(&unblock_signals, SIGTERM);
+ sigaddset(&unblock_signals, SIGCONT);
+ sigaddset(&unblock_signals, SIGSTOP);
+ sigaddset(&unblock_signals, SIGTSTP);
+ sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL);
+
message(CONSOLE|LOG, "\rTrying to re-exec %s\n", a->command);
execl(a->command, a->command, NULL);