poller: Retry poll immediately on EINTR

There is nothing for us to dispatch unless we wake on an fd, so just
retry poll if it fails with EINTR instead of doing a full dispatch loop.
This commit is contained in:
Kenny Levinsen 2020-11-23 16:48:18 +01:00
parent 3c80a9db96
commit df8494af61

View file

@ -315,9 +315,11 @@ int poller_poll(struct poller *poller) {
poller->dirty = false; poller->dirty = false;
} }
if (poll(poller->pollfds, poller->fd_event_sources, -1) == -1 && errno != EINTR) { while (poll(poller->pollfds, poller->fd_event_sources, -1) == -1) {
if (errno != EINTR) {
return -1; return -1;
} }
}
dispatch(poller); dispatch(poller);