From 76d16526bcba1f2165928285cf0439d11f9ca629 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 22 Feb 2018 15:14:46 -0500 Subject: Handle EINTR from kevent --- view.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'view.c') diff --git a/view.c b/view.c index be69fef..9ae0ec6 100644 --- a/view.c +++ b/view.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -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) { -- cgit 1.4.1