~kennylevinsen/seatd

df8494af61356be3b2c575bd3f6a33090a286248 — Kenny Levinsen 2 months ago 3c80a9d
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.
1 files changed, 4 insertions(+), 2 deletions(-)

M seatd/poller.c
M seatd/poller.c => seatd/poller.c +4 -2
@@ 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);