summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2003-10-19 22:49:11 +0000
committermarc <marc@openbsd.org>2003-10-19 22:49:11 +0000
commitbbeec872371bf35f181853c909d3856db4268559 (patch)
tree0bee70d17a197ab04c6624060d64e790eb71d31b /lib/libpthread
parentfix installation of DEBUGLIBS libcurses symlink. (diff)
downloadwireguard-openbsd-bbeec872371bf35f181853c909d3856db4268559.tar.xz
wireguard-openbsd-bbeec872371bf35f181853c909d3856db4268559.zip
Fix optimized select handling buglet. Patch from tholo@
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_select.c b/lib/libpthread/uthread/uthread_select.c
index 5a961104c15..33620ffc254 100644
--- a/lib/libpthread/uthread/uthread_select.c
+++ b/lib/libpthread/uthread/uthread_select.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_select.c,v 1.7 2003/10/16 21:50:50 millert Exp $ */
+/* $OpenBSD: uthread_select.c,v 1.8 2003/10/19 22:49:11 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -84,7 +84,7 @@ select(int numfds, fd_set * readfds, fd_set * writefds,
}
/* Count the number of file descriptors to be polled: */
- if (readfds || writefds || exceptfds) {
+ if (numfds && (readfds || writefds || exceptfds)) {
for (i = (numfds - 1) / NFDBITS; i >= 0; i--) {
rmask = readfds ? readfds->fds_bits[i] : 0;
wmask = writefds ? writefds->fds_bits[i] : 0;