Browse code

r9095 invalidly removed the check for non-winsock

Originally committed as revision 9096 to svn://svn.ffmpeg.org/ffmpeg/trunk

Alex Beregszaszi authored on 2007/05/22 01:08:03
Showing 1 changed files
... ...
@@ -139,10 +139,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
139 139
     int n;
140 140
     int rc;
141 141
 
142
+#ifdef __MINGW32__
142 143
     if (numfds >= FD_SETSIZE) {
143 144
         errno = EINVAL;
144 145
         return -1;
145 146
     }
147
+#endif
146 148
 
147 149
     FD_ZERO(&read_set);
148 150
     FD_ZERO(&write_set);
... ...
@@ -152,6 +154,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
152 152
     for(i = 0; i < numfds; i++) {
153 153
         if (fds[i].fd < 0)
154 154
             continue;
155
+#ifndef __MINGW32__
156
+        if (fds[i].fd >= FD_SETSIZE) {
157
+            errno = EINVAL;
158
+            return -1;
159
+        }
160
+#endif
155 161
 
156 162
         if (fds[i].events & POLLIN)  FD_SET(fds[i].fd, &read_set);
157 163
         if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, &write_set);