mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-27 01:40:16 -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)];
|
struct epoll_event events[tll_length(fdm->fds)];
|
||||||
|
|
||||||
int r;
|
int r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
||||||
do {
|
if (unlikely(r < 0)) {
|
||||||
r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
if (errno == EINTR)
|
||||||
} while (unlikely(r < 0 && errno == EINTR));
|
return true;
|
||||||
|
|
||||||
if (r < 0) {
|
|
||||||
LOG_ERRNO("failed to epoll");
|
LOG_ERRNO("failed to epoll");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue