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:
parent
3c80a9db96
commit
df8494af61
1 changed files with 4 additions and 2 deletions
|
@ -315,8 +315,10 @@ int poller_poll(struct poller *poller) {
|
|||
poller->dirty = false;
|
||||
}
|
||||
|
||||
if (poll(poller->pollfds, poller->fd_event_sources, -1) == -1 && errno != EINTR) {
|
||||
return -1;
|
||||
while (poll(poller->pollfds, poller->fd_event_sources, -1) == -1) {
|
||||
if (errno != EINTR) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
dispatch(poller);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue