From 9c5e34df0fbc1892bcb6d51ec629a02e4f677a46 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 20 Oct 2021 15:40:50 +1100 Subject: [PATCH] [client] x11: handle EINTR properly in epoll loop --- client/displayservers/X11/x11.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index f2a35220..30a0815f 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -748,6 +749,9 @@ static int x11EventThread(void * unused) int nfds = epoll_wait(epollfd, events, 1, 100); if (nfds == -1) { + if (errno == EINTR) + continue; + close(epollfd); DEBUG_ERROR("epoll_wait failure"); return 0;