X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/91d9cdd3ca06d1809bc05a285dafdea2954850b2..fe53310bc2e7636f1dd16001684d0c5d936cd292:/openssh/openbsd-compat/bsd-poll.c diff --git a/openssh/openbsd-compat/bsd-poll.c b/openssh/openbsd-compat/bsd-poll.c index 970c3b3..4dd6fc4 100644 --- a/openssh/openbsd-compat/bsd-poll.c +++ b/openssh/openbsd-compat/bsd-poll.c @@ -17,13 +17,12 @@ */ #include "includes.h" -#if !defined(HAVE_POLL) +#if !defined(HAVE_POLL) && defined(HAVE_SELECT) #ifdef HAVE_SYS_SELECT_H # include #endif -#include #include #include "bsd-poll.h" @@ -46,12 +45,11 @@ 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, fd); + maxfd = MAX(maxfd, fds[i].fd); } nmemb = howmany(maxfd + 1 , NFDBITS);