*/
#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"
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);