fdm: keep polling on EINTR

This commit is contained in:
Daniel Eklöf 2020-11-26 18:23:01 +01:00
parent 903a8eaf4a
commit 15b35b7641
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

9
fdm.c
View file

@ -324,11 +324,12 @@ fdm_poll(struct fdm *fdm)
struct epoll_event events[tll_length(fdm->fds)];
int r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
if (r == -1) {
if (errno == EINTR)
return true;
int r;
do {
r = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
} while (unlikely(r < 0 && errno == EINTR));
if (r < 0) {
LOG_ERRNO("failed to epoll");
return false;
}