diff options
author | Kenny Levinsen <kl@kl.wtf> | 2020-11-23 16:48:18 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2020-11-23 16:48:18 +0100 |
commit | df8494af61356be3b2c575bd3f6a33090a286248 (patch) | |
tree | 51500969ee1a7416ae468e0fbffb479d54870af9 /seatd/poller.c | |
parent | 3c80a9db9628aec7009d7e51c1a3393bc801078c (diff) |
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.
Diffstat (limited to 'seatd/poller.c')
-rw-r--r-- | seatd/poller.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/seatd/poller.c b/seatd/poller.c index 267929b..ceadb24 100644 --- a/seatd/poller.c +++ b/seatd/poller.c @@ -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); |