From: Pierre Ossman Date: Wed, 5 Oct 2016 12:44:24 +0000 (+0200) Subject: Handle select() errors X-Git-Tag: v1.7.90~75 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c9012b56d71a6eebd3608406d32d977d08d603b;p=tigervnc.git Handle select() errors --- diff --git a/unix/xserver/hw/vnc/vncBlockHandler.c b/unix/xserver/hw/vnc/vncBlockHandler.c index 604dc4ab..390a9b3c 100644 --- a/unix/xserver/hw/vnc/vncBlockHandler.c +++ b/unix/xserver/hw/vnc/vncBlockHandler.c @@ -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))