summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2008-08-30 07:32:37 +1000
committerDarren Tucker <dtucker@zip.com.au>2008-08-30 07:32:37 +1000
commit661f63b7d2a89d91c29691ba8d01b825600e6789 (patch)
tree3c4f42cc328145aa7cf05fb0771d9bdb24653859
parent212f0b08790c415648db250797b1b060b62a015d (diff)
- (dtucker) [openbsd-compat/bsd-poll.c] correctly check for number of FDs
larger than FD_SETSIZE (OpenSSH only ever uses poll with one fd). Patch from Nicholas Marriott.
-rw-r--r--ChangeLog7
-rw-r--r--openbsd-compat/bsd-poll.c5
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 99b450ac..5d76889a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20080830
+ - (dtucker) [openbsd-compat/bsd-poll.c] correctly check for number of FDs
+ larger than FD_SETSIZE (OpenSSH only ever uses poll with one fd). Patch
+ from Nicholas Marriott.
+
20080721
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2008/07/23 07:36:55
@@ -4721,4 +4726,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.5097 2008/07/23 07:42:29 djm Exp $
+$Id: ChangeLog,v 1.5098 2008/08/29 21:32:37 dtucker Exp $
diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c
index 284db3a1..f899d7a2 100644
--- a/openbsd-compat/bsd-poll.c
+++ b/openbsd-compat/bsd-poll.c
@@ -1,4 +1,4 @@
-/* $Id: bsd-poll.c,v 1.3 2008/04/04 05:16:36 djm Exp $ */
+/* $Id: bsd-poll.c,v 1.4 2008/08/29 21:32:38 dtucker Exp $ */
/*
* Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au).
@@ -46,11 +46,12 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout)
struct timeval tv, *tvp = NULL;
for (i = 0; i < nfds; i++) {
+ fd = fds[i].fd;
if (fd >= FD_SETSIZE) {
errno = EINVAL;
return -1;
}
- maxfd = MAX(maxfd, fds[i].fd);
+ maxfd = MAX(maxfd, fd);
}
nmemb = howmany(maxfd + 1 , NFDBITS);