summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anylike.org>2010-10-03 23:10:47 +0000
committerChristian Pointner <equinox@anylike.org>2010-10-03 23:10:47 +0000
commitc3f8186a345ae7ed79f3bdc6e84f907f8f6c5efb (patch)
tree78fcd3ab59309de4d87eb564b21fb495989b3275
parentfixed typo (diff)
ignoring SIG_CHLD by default
-rw-r--r--src/sig_handler.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sig_handler.c b/src/sig_handler.c
index 49e9c2a..1f7f3a1 100644
--- a/src/sig_handler.c
+++ b/src/sig_handler.c
@@ -81,13 +81,13 @@ int signal_init()
}
}
- struct sigaction act, act_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) ||
@@ -95,7 +95,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(SIGUSR1, &act, NULL);
sigaction(SIGUSR2, &act, NULL);
sigaction(SIGPIPE, &act, NULL);
+ sigaction(SIGCHLD, &act, NULL);
close(sig_pipe_fds[0]);
close(sig_pipe_fds[1]);