From 87ba044ea4e146cc6829be6ee62ba3ef664a98fa Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 12 Jun 2023 11:38:42 -0700 Subject: [PATCH] [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. :) --- libami/module.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libami/module.c b/libami/module.c index ff1bdaa..76cbbec 100644 --- a/libami/module.c +++ b/libami/module.c @@ -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)) {