summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-01-16 17:54:21 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-01-16 17:54:21 +0000
commit64948f40979fb0746871e238549160ba357c72df (patch)
tree2b0afbd4ad3ca18b41589f9e39cd5eebe09ea73f /src
parent2a37e589347ff6f16d221f12f2ec622efda0e95c (diff)
- ircd_signal.c:setup_signals(): fixed bug where signals stopped from
working after restaring the ircd via SIGINT. Spotted and fixed by Adam. git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2835 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r--src/ircd_signal.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/ircd_signal.c b/src/ircd_signal.c
index ee757da..a33bcc5 100644
--- a/src/ircd_signal.c
+++ b/src/ircd_signal.c
@@ -95,44 +95,49 @@ setup_signals(void)
act.sa_handler = SIG_IGN;
sigemptyset(&act.sa_mask);
- sigaddset(&act.sa_mask, SIGPIPE);
- sigaddset(&act.sa_mask, SIGALRM);
- sigaction(SIGALRM, &act, 0);
+#ifdef SIGXFSZ
+ sigaddset(&act.sa_mask, SIGXFSZ);
+#endif
+#ifdef SIGWINCH
+ sigaddset(&act.sa_mask, SIGWINCH);
+#endif
#ifdef SIGTRAP
sigaddset(&act.sa_mask, SIGTRAP);
#endif
+ sigaddset(&act.sa_mask, SIGPIPE);
+ sigaddset(&act.sa_mask, SIGALRM);
+ sigaddset(&act.sa_mask, SIGHUP);
+ sigaddset(&act.sa_mask, SIGINT);
+ sigaddset(&act.sa_mask, SIGTERM);
+ sigaddset(&act.sa_mask, SIGUSR1);
+ sigaddset(&act.sa_mask, SIGCHLD);
+
#ifdef SIGXFSZ
- sigaddset(&act.sa_mask, SIGXFSZ);
sigaction(SIGXFSZ, &act, 0);
#endif
-
#ifdef SIGWINCH
- sigaddset(&act.sa_mask, SIGWINCH);
sigaction(SIGWINCH, &act, 0);
#endif
- sigaction(SIGPIPE, &act, 0);
#ifdef SIGTRAP
sigaction(SIGTRAP, &act, 0);
#endif
+ sigaction(SIGPIPE, &act, 0);
+ sigaction(SIGALRM, &act, 0);
act.sa_handler = sighup_handler;
- sigemptyset(&act.sa_mask);
- sigaddset(&act.sa_mask, SIGHUP);
sigaction(SIGHUP, &act, 0);
act.sa_handler = sigint_handler;
- sigaddset(&act.sa_mask, SIGINT);
sigaction(SIGINT, &act, 0);
act.sa_handler = sigterm_handler;
- sigaddset(&act.sa_mask, SIGTERM);
sigaction(SIGTERM, &act, 0);
act.sa_handler = sigusr1_handler;
- sigaddset(&act.sa_mask, SIGUSR1);
sigaction(SIGUSR1, &act, 0);
act.sa_handler = sigchld_handler;
- sigaddset(&act.sa_mask, SIGCHLD);
sigaction(SIGCHLD, &act, 0);
+
+ sigprocmask(SIG_UNBLOCK, &act.sa_mask, NULL);
}