From df8494af61356be3b2c575bd3f6a33090a286248 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 23 Nov 2020 16:48:18 +0100 Subject: 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. --- seatd/poller.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'seatd') 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); -- cgit v1.2.3