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

9
main.c
View file

@ -279,11 +279,6 @@ main(int argc, char *const *argv)
sigaction(SIGINT, &sa, NULL); sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &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 /* Block SIGINT (this is under the assumption that threads inherit
* the signal mask */ * the signal mask */
sigset_t signal_mask; sigset_t signal_mask;
@ -341,8 +336,9 @@ main(int argc, char *const *argv)
while (!aborted) { while (!aborted) {
struct pollfd fds[] = {{.fd = abort_fd, .events = POLLIN}}; 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);
if (fds[0].revents & (POLLIN | POLLHUP)) {
/* /*
* Either the bar aborted (triggering the abort_fd), or user * Either the bar aborted (triggering the abort_fd), or user
* killed us (triggering the signal handler which sets * killed us (triggering the signal handler which sets
@ -351,6 +347,7 @@ main(int argc, char *const *argv)
assert(aborted || r == 1); assert(aborted || r == 1);
break; break;
} }
}
if (aborted) if (aborted)
LOG_INFO("aborted: %s (%d)", strsignal(aborted), aborted); LOG_INFO("aborted: %s (%d)", strsignal(aborted), aborted);