forked from external/yambar
main: no need to block SIGCHLD anymore, we don’t use it
This commit is contained in:
parent
ba54e709ee
commit
2fe602a6a2
1 changed files with 10 additions and 13 deletions
23
main.c
23
main.c
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue