fd_set fds_read;
fd_set fds_write;
fd_set fds_err;
- int maxfd;
+ curl_socket_t maxfd;
int r;
int ret;
fd_set fds_read;
fd_set fds_write;
fd_set fds_err;
- int maxfd;
+ curl_socket_t maxfd;
int r;
unsigned int i;
maxfd = -1;
for (i = 0; i < nfds; i++) {
- if (ufds[i].fd < 0)
+ if (ufds[i].fd == CURL_SOCKET_BAD)
continue;
+#ifndef WIN32 /* This is harmless and wrong on Win32 */
if (ufds[i].fd >= FD_SETSIZE) {
errno = EINVAL;
return -1;
}
+#endif
if (ufds[i].fd > maxfd)
maxfd = ufds[i].fd;
if (ufds[i].events & POLLIN)
r = 0;
for (i = 0; i < nfds; i++) {
ufds[i].revents = 0;
- if (ufds[i].fd < 0)
+ if (ufds[i].fd == CURL_SOCKET_BAD)
continue;
if (FD_ISSET(ufds[i].fd, &fds_read))
ufds[i].revents |= POLLIN;