mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
fdm: keep polling on EINTR
This commit is contained in:
parent
903a8eaf4a
commit
15b35b7641
1 changed files with 5 additions and 4 deletions
9
fdm.c
9
fdm.c
|
|
@ -324,11 +324,12 @@ fdm_poll(struct fdm *fdm)
|
||||||
|
|
||||||
struct epoll_event events[tll_length(fdm->fds)];
|
struct epoll_event events[tll_length(fdm->fds)];
|
||||||
|
|
||||||
int r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
int r;
|
||||||
if (r == -1) {
|
do {
|
||||||
if (errno == EINTR)
|
r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
||||||
return true;
|
} while (unlikely(r < 0 && errno == EINTR));
|
||||||
|
|
||||||
|
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