X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=door_daemon%2Fsig_handler.c;h=5cdaaa15a39db0bf1c93217c417e2a270518daea;hb=4abb3ec7655723725bd62ffc53600a6396de1513;hp=ca2e18fa67b7336ba3ac7dda1a8b9c0fb87ee8cb;hpb=629238875b234aaa1a33b0eefc76bd89b8cb3a54;p=svn42.git diff --git a/door_daemon/sig_handler.c b/door_daemon/sig_handler.c index ca2e18f..5cdaaa1 100644 --- a/door_daemon/sig_handler.c +++ b/door_daemon/sig_handler.c @@ -82,17 +82,22 @@ int signal_init() } } - struct sigaction act; + struct sigaction act, 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; if((sigaction(SIGINT, &act, NULL) < 0) || (sigaction(SIGQUIT, &act, NULL) < 0) || (sigaction(SIGTERM, &act, NULL) < 0) || (sigaction(SIGHUP, &act, NULL) < 0) || (sigaction(SIGUSR1, &act, NULL) < 0) || - (sigaction(SIGUSR2, &act, NULL) < 0)) { + (sigaction(SIGUSR2, &act, NULL) < 0) || + (sigaction(SIGCHLD, &act_ign, NULL) < 0) || + (sigaction(SIGPIPE, &act_ign, NULL) < 0)) { log_printf(ERROR, "signal handling init failed (sigaction error: %s)", strerror(errno)); close(sig_pipe_fds[0]); @@ -153,6 +158,8 @@ void signal_stop() sigaction(SIGHUP, &act, NULL); 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]);