]> git.sesse.net Git - vlc/blobdiff - src/network/poll.c
Remove Unneeded test (thx ipkiss)
[vlc] / src / network / poll.c
index b8b19721a2f3737ba4e459cd48bc2da06fe26d64..df92479e0334a283c6539a669372001a8780df0e 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 
 #ifndef HAVE_POLL
 #include <string.h>
@@ -61,7 +65,7 @@ int poll (struct pollfd *fds, unsigned nfds, int timeout)
         tv.tv_usec = d.rem * 1000;
     }
 
-    val = select (val + 1, &rdset, &wrset, NULL,
+    val = select (val + 1, &rdset, &wrset, &exset,
                   (timeout >= 0) ? &tv : NULL);
     if (val == -1)
         return -1;
@@ -69,9 +73,9 @@ int poll (struct pollfd *fds, unsigned nfds, int timeout)
     for (unsigned i = 0; i < nfds; i++)
     {
         int fd = fds[i].fd;
-        fds[i].revents = (FD_ISSET (fds[i].fd, &rdset) ? POLLIN : 0)
-                       | (FD_ISSET (fds[i].fd, &wrset) ? POLLOUT : 0)
-                       | (FD_ISSET (fds[i].fd, &exset) ? POLLPRI : 0);
+        fds[i].revents = (FD_ISSET (fd, &rdset) ? POLLIN : 0)
+                       | (FD_ISSET (fd, &wrset) ? POLLOUT : 0)
+                       | (FD_ISSET (fd, &exset) ? POLLPRI : 0);
     }
     return val;
 }