]> source.dussan.org Git - tigervnc.git/commitdiff
Handle select() errors
authorPierre Ossman <ossman@cendio.se>
Wed, 5 Oct 2016 12:44:24 +0000 (14:44 +0200)
committerPierre Ossman <ossman@cendio.se>
Wed, 5 Oct 2016 12:44:24 +0000 (14:44 +0200)
unix/xserver/hw/vnc/vncBlockHandler.c

index 604dc4abb81f2d0ed0144663221aef5c8cb929bf..390a9b3c46881a7d12c20e8e4deb0205ae44dc4e 100644 (file)
@@ -191,6 +191,9 @@ static void vncWakeupHandler(void * data, int nfds, void * readmask)
 
   static struct vncFdEntry* entry;
 
+  if (nfds <= 0)
+    return;
+
   entry = fdsHead;
   while (entry) {
     if (entry->read && FD_ISSET(entry->fd, fds))
@@ -231,6 +234,9 @@ void vncWriteWakeupHandler(int nfds, fd_set *fds)
 {
   static struct vncFdEntry* entry;
 
+  if (nfds <= 0)
+    return;
+
   entry = fdsHead;
   while (entry) {
     if (entry->write && FD_ISSET(entry->fd, fds))