Fixed a problem with crashing on select() returning EINTR error.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@311 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/x0vncserver/x0vncserver.cxx b/x0vncserver/x0vncserver.cxx
index e0d05f0..ca96fd7 100644
--- a/x0vncserver/x0vncserver.cxx
+++ b/x0vncserver/x0vncserver.cxx
@@ -467,7 +467,14 @@
}
int n = select(FD_SETSIZE, &rfds, 0, 0, &tv);
- if (n < 0) throw rdr::SystemException("select",errno);
+ if (n < 0) {
+ if (errno == EINTR) {
+ vlog.debug("interrupted select() system call");
+ continue;
+ } else {
+ throw rdr::SystemException("select", errno);
+ }
+ }
if (FD_ISSET(listener.getFd(), &rfds)) {
Socket* sock = listener.accept();