diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-10-03 23:35:39 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-10-03 23:35:39 (GMT) |
commit | 2e44bfd10863b18f4afb806bb933db6f2604b2dc (patch) | |
tree | 7c3540a55dac57f4b54db70a823867138890ebb4 | |
parent | 89a8b7519bccc589b9a4a723d84f56a157d40a0e (diff) |
blocking SIG_CHLD by default
-rw-r--r-- | sig_handler.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sig_handler.c b/sig_handler.c index 23ccbec..ed4c140 100644 --- a/sig_handler.c +++ b/sig_handler.c @@ -82,13 +82,13 @@ int signal_init() } } - struct sigaction act, agt_ign; + struct sigaction act, ign; act.sa_handler = sig_handler; sigfillset(&act.sa_mask); act.sa_flags = 0; - act_ign.sa_handler = SIG_IGN; - sigfillset(&act_ign.sa_mask); - act_ign.sa_flags = 0; + ign.sa_handler = SIG_IGN; + sigfillset(&ign.sa_mask); + ign.sa_flags = 0; if((sigaction(SIGINT, &act, NULL) < 0) || (sigaction(SIGQUIT, &act, NULL) < 0) || @@ -96,7 +96,8 @@ int signal_init() (sigaction(SIGHUP, &act, NULL) < 0) || (sigaction(SIGUSR1, &act, NULL) < 0) || (sigaction(SIGUSR2, &act, NULL) < 0) || - (sigaction(SIGPIPE, &act_ign, NULL) < 0)) { + (sigaction(SIGCHLD, &ign, NULL) < 0) || + (sigaction(SIGPIPE, &ign, NULL) < 0)) { log_printf(ERROR, "signal handling init failed (sigaction error: %s)", strerror(errno)); close(sig_pipe_fds[0]); @@ -157,6 +158,7 @@ void signal_stop() sigaction(SIGHUP, &act, NULL); sigaction(SIGUSR1, &act, NULL); sigaction(SIGUSR2, &act, NULL); + sigaction(SIGCHLD, &act, NULL); sigaction(SIGPIPE, &act, NULL); close(sig_pipe_fds[0]); |