Commit 64cd8a9d authored by alex's avatar alex

r9095 invalidly removed the check for non-winsock

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9096 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent cca41ae9
...@@ -139,10 +139,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) ...@@ -139,10 +139,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
int n; int n;
int rc; int rc;
#ifdef __MINGW32__
if (numfds >= FD_SETSIZE) { if (numfds >= FD_SETSIZE) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
#endif
FD_ZERO(&read_set); FD_ZERO(&read_set);
FD_ZERO(&write_set); FD_ZERO(&write_set);
...@@ -152,6 +154,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) ...@@ -152,6 +154,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
for(i = 0; i < numfds; i++) { for(i = 0; i < numfds; i++) {
if (fds[i].fd < 0) if (fds[i].fd < 0)
continue; continue;
#ifndef __MINGW32__
if (fds[i].fd >= FD_SETSIZE) {
errno = EINVAL;
return -1;
}
#endif
if (fds[i].events & POLLIN) FD_SET(fds[i].fd, &read_set); if (fds[i].events & POLLIN) FD_SET(fds[i].fd, &read_set);
if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, &write_set); if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, &write_set);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment