summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--view.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/view.c b/view.c
index be69fef..9ae0ec6 100644
--- a/view.c
+++ b/view.c
@@ -17,6 +17,7 @@
 #include <sys/types.h>
 
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
 #include <signal.h>
@@ -101,7 +102,10 @@ int main(int argc, char *argv[]) {
     for (;;) {
         struct kevent event;
         int nevents = kevent(kq, NULL, 0, &event, 1, NULL);
-        if (nevents < 0) err(EX_OSERR, "kevent");
+        if (nevents < 0) {
+            if (errno == EINTR) continue;
+            err(EX_OSERR, "kevent");
+        }
         if (!nevents) continue;
 
         if (event.ident == (uintptr_t)winch.read) {