summaryrefslogtreecommitdiff
path: root/ev_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'ev_select.c')
-rw-r--r--ev_select.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ev_select.c b/ev_select.c
index fcebcc6..9c63f0d 100644
--- a/ev_select.c
+++ b/ev_select.c
@@ -134,7 +134,16 @@ select_poll (EV_P_ ev_tstamp timeout)
tv.tv_sec = (long)timeout;
tv.tv_usec = (long)((timeout - (ev_tstamp)tv.tv_sec) * 1e6);
+#ifdef _WIN32
+ /* pass in the write set as except set.
+ * the idea behind this is to work around a windows bug that causes
+ * errors to be reported as an exception and not by setting
+ * the writable bit. this is so uncontrollably lame.
+ */
+ res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, (fd_set *)vec_wo, &tv);
+#else
res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv);
+#endif
if (expect_false (res < 0))
{