[libami] handle EINTR from select() as a non-error

EINTR is happening during suspend/resume, which was causing all of
the modules to die (and requiring a restart of amiwm to re-run all
of its modules.)

This fixes things in FreeBSD suspend/resume so, well, the modules
keep working. :)
This commit is contained in:
Adrian Chadd
2023-06-12 11:38:42 -07:00
parent 1a8a15e24f
commit 87ba044ea4

View File

@@ -81,6 +81,13 @@ md_wait_read_fd(void)
return (0);
}
if (ret < 0) {
/*
* Note: this happens during things like system suspend/resume
* on FreeBSD.
*/
if (errno == EINTR) {
return (0);
}
return (-1);
}
if (FD_ISSET(md_in_fd, &readfds)) {