From: Steinar H. Gunderson Date: Sun, 7 Apr 2013 15:46:32 +0000 (+0200) Subject: Handle EINTR in epoll_wait(). X-Git-Tag: 1.0.0~187 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=bf0358e8f7782615cf7c01ed0fdcac7ed2400111 Handle EINTR in epoll_wait(). --- diff --git a/server.cpp b/server.cpp index 7e43522..e26a85b 100644 --- a/server.cpp +++ b/server.cpp @@ -140,6 +140,9 @@ void Server::do_work() { for ( ;; ) { int nfds = epoll_wait(epoll_fd, events, EPOLL_MAX_EVENTS, EPOLL_TIMEOUT_MS); + if (nfds == -1 && errno == EINTR) { + continue; + } if (nfds == -1) { perror("epoll_wait"); exit(1);