Make custom SIGUSR signals work again.
These were broken long ago when converting from signal() to sigprocmask(). This change also makes ctrl+c work again.
This commit is contained in:
parent
fb143995d2
commit
ba046c02c7
@ -166,7 +166,7 @@ static void setup_signals_ndhc(void)
|
||||
sigaddset(&mask, SIGUSR2);
|
||||
sigaddset(&mask, SIGCHLD);
|
||||
sigaddset(&mask, SIGTERM);
|
||||
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
|
||||
if (sigprocmask(SIG_UNBLOCK, &mask, (sigset_t *)0) < 0)
|
||||
suicide("sigprocmask failed");
|
||||
if (cs.signalFd >= 0) {
|
||||
epoll_del(cs.epollFd, cs.signalFd);
|
||||
|
@ -77,7 +77,7 @@ int setup_signals_subprocess(void)
|
||||
sigaddset(&mask, SIGHUP);
|
||||
sigaddset(&mask, SIGINT);
|
||||
sigaddset(&mask, SIGTERM);
|
||||
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
|
||||
if (sigprocmask(SIG_UNBLOCK, &mask, (sigset_t *)0) < 0)
|
||||
suicide("sigprocmask failed");
|
||||
int sfd = signalfd(-1, &mask, SFD_NONBLOCK);
|
||||
if (sfd < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user