]> andersk Git - gssapi-openssh.git/blobdiff - openssh/openbsd-compat/bsd-poll.c
Import of OpenSSH 5.2p1
[gssapi-openssh.git] / openssh / openbsd-compat / bsd-poll.c
index 4dd6fc4aa7f1d104b3841395e3fda0ec1dfeea01..970c3b348ba86d8bbf319dd0d4c802467f92edad 100644 (file)
  */
 
 #include "includes.h"
-#if !defined(HAVE_POLL) && defined(HAVE_SELECT)
+#if !defined(HAVE_POLL)
 
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
 #endif
 
+#include <stdlib.h>
 #include <errno.h>
 #include "bsd-poll.h"
 
@@ -45,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);
This page took 0.040575 seconds and 4 git commands to generate.