mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
fdm: do *not* keep polling on EINTR
This fixes an issue where foot --server did not exit on SIGINT. This happened because we never returned out from fdm_poll(), and thus we never saw ‘aborted’ being set.
This commit is contained in:
parent
c1c42f047e
commit
384ba4d30d
1 changed files with 4 additions and 5 deletions
9
fdm.c
9
fdm.c
|
|
@ -324,12 +324,11 @@ fdm_poll(struct fdm *fdm)
|
|||
|
||||
struct epoll_event events[tll_length(fdm->fds)];
|
||||
|
||||
int r;
|
||||
do {
|
||||
r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
||||
} while (unlikely(r < 0 && errno == EINTR));
|
||||
int r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
||||
if (unlikely(r < 0)) {
|
||||
if (errno == EINTR)
|
||||
return true;
|
||||
|
||||
if (r < 0) {
|
||||
LOG_ERRNO("failed to epoll");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue