main: no need to block SIGCHLD anymore, we don’t use it

This commit is contained in:
Daniel Eklöf 2020-11-02 19:15:42 +01:00
parent ba54e709ee
commit 2fe602a6a2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

23
main.c
View file

@ -279,11 +279,6 @@ main(int argc, char *const *argv)
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
sigset_t proc_signal_mask;
sigemptyset(&proc_signal_mask);
sigaddset(&proc_signal_mask, SIGCHLD);
sigprocmask(SIG_BLOCK, &proc_signal_mask, NULL);
/* Block SIGINT (this is under the assumption that threads inherit
* the signal mask */
sigset_t signal_mask;
@ -341,15 +336,17 @@ main(int argc, char *const *argv)
while (!aborted) {
struct pollfd fds[] = {{.fd = abort_fd, .events = POLLIN}};
int r __attribute__((unused)) = poll(fds, 1, -1);
int r __attribute__((unused)) = poll(fds, sizeof(fds) / sizeof(fds[0]), -1);
/*
* Either the bar aborted (triggering the abort_fd), or user
* killed us (triggering the signal handler which sets
* 'aborted')
*/
assert(aborted || r == 1);
break;
if (fds[0].revents & (POLLIN | POLLHUP)) {
/*
* Either the bar aborted (triggering the abort_fd), or user
* killed us (triggering the signal handler which sets
* 'aborted')
*/
assert(aborted || r == 1);
break;
}
}
if (aborted)