daemon: EINTR from kevent(2) is not a fatal error

Simply resume waiting for events rather than exiting if we took a signal
here.

This at least fixes running programs under daemon(8) in the face of
suspend/resume, which I suspect hits us with a spurious EINTR rather
than a signal anyways.

Reported and tested by:	manu
Fixes:	8935a39932 ("daemon: use kqueue for all events")
This commit is contained in:
Kyle Evans 2023-05-05 10:12:13 -05:00
parent c2eae5c39a
commit 494e7dfdbe

View File

@ -427,6 +427,8 @@ daemon_eventloop(struct daemon_state *state)
ret = kevent(kq, NULL, 0, &event, 1, NULL);
switch (ret) {
case -1:
if (errno == EINTR)
continue;
err(EXIT_FAILURE, "kevent wait");
case 0:
continue;