diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2003-10-19 22:49:12 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2003-10-19 22:49:12 +0000 |
commit | db28996a9a376dad8a599013e115ac6cf3b3e973 (patch) | |
tree | a4823d0a566a275cc59fcba10f52debdaad21d6f /lib/libpthread/uthread | |
parent | 93bc89b910e6cfadec254b9ff28cb49cf6ef95d3 (diff) |
Fix optimized select handling buglet. Patch from tholo@
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_select.c | 4 |
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; |