Merge pull request #5382 from kumpera/pedump_fix
[mono.git] / mono / utils / mono-poll.c
index 5e5adfe2f0009e64f32907f1750abc671ce1376a..f759b68b4b2ab98387f5470b1f11f17cec454798 100755 (executable)
@@ -1,3 +1,14 @@
+/**
+ * \file
+ */
+
+#include <config.h>
+
+#ifdef HOST_WIN32
+/* For select */
+#include <winsock2.h>
+#endif
+
 #include "mono-poll.h"
 #include <errno.h>
 
@@ -20,11 +31,6 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
 }
 #else
 
-#ifdef HOST_WIN32
-/* For select */
-#include <winsock2.h>
-#endif
-
 int
 mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
 {
@@ -58,7 +64,7 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
                        return 1;
                }
 #else
-               if (fd > FD_SETSIZE) {
+               if (fd >= FD_SETSIZE) {
                        ufds [i].revents = MONO_POLLNVAL;
                        return 1;
                }