]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only mask off the signals we are interested in catching.
authorRoy Marples <roy@marples.name>
Fri, 12 Aug 2016 16:34:01 +0000 (16:34 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Aug 2016 16:34:01 +0000 (16:34 +0000)
eloop.c

diff --git a/eloop.c b/eloop.c
index c72f0c5b4ca838a965fae9d2a8fe854fef8f5625..a54a0f3e51cdd34b65ee2c432a885432c5081c99 100644 (file)
--- a/eloop.c
+++ b/eloop.c
@@ -744,20 +744,20 @@ int
 eloop_signal_mask(struct eloop *eloop, sigset_t *oldset)
 {
        sigset_t newset;
-#ifndef HAVE_KQUEUE
        size_t i;
+#ifndef HAVE_KQUEUE
        struct sigaction sa;
 #endif
 
        assert(eloop != NULL);
 
-       sigfillset(&newset);
+       sigemptyset(&newset);
+       for (i = 0; i < eloop->signals_len; i++)
+               sigaddset(&newset, eloop->signals[i]);
        if (sigprocmask(SIG_SETMASK, &newset, oldset) == -1)
                return -1;
 
-#ifdef HAVE_KQUEUE
-       UNUSED(eloop);
-#else
+#ifndef HAVE_KQUEUE
        memset(&sa, 0, sizeof(sa));
        sa.sa_sigaction = eloop_signal3;
        sa.sa_flags = SA_SIGINFO;