summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-31 06:49:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-31 06:50:13 +0200
commit1d81d51e1e5e9db6c493ae2fe17280627fff15a6 (patch)
tree5f0b5455c87f3cb06e8f70fdeb119e361b07c66d /src
parent6ed0948d5df69ff81404a702cfbebe3217fa2f90 (diff)
downloadfastd-1d81d51e1e5e9db6c493ae2fe17280627fff15a6.tar
fastd-1d81d51e1e5e9db6c493ae2fe17280627fff15a6.zip
Fix blocking signals...
Diffstat (limited to 'src')
-rw-r--r--src/fastd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/fastd.c b/src/fastd.c
index c7a5f1e..378d641 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -94,18 +94,15 @@ static void on_sigchld(int signo UNUSED) {
/** Installs signal handlers */
static void init_signals(void) {
- struct sigaction action;
-
- sigset_t set, oldset;
+ sigset_t set;
sigfillset(&set);
- pthread_sigmask(SIG_SETMASK, &set, &oldset);
+ /* block all signals */
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
+ struct sigaction action;
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
- /* unblock all signals */
- sigprocmask(SIG_SETMASK, &action.sa_mask, NULL);
-
action.sa_handler = on_sighup;
if (sigaction(SIGHUP, &action, NULL))
exit_errno("sigaction");