summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2011-02-07 21:45:32 +0000
committerroot <root>2011-02-07 21:45:32 +0000
commit0eee55b11b154595ce4856ddda9802cdbacc4e86 (patch)
tree24b01b2b8a066121657fc3946c249419e46bea8a /ev.c
parentb817b653122bd9cdbb127aa0b8976ef95cfdf2a9 (diff)
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/ev.c b/ev.c
index c888e22..0d71a40 100644
--- a/ev.c
+++ b/ev.c
@@ -976,6 +976,31 @@ fd_reify (EV_P)
{
int i;
+#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP
+ for (i = 0; i < fdchangecnt; ++i)
+ {
+ int fd = fdchanges [i];
+ ANFD *anfd = anfds + fd;
+
+ if (anfd->reify & EV__IOFDSET)
+ {
+ SOCKET handle = EV_FD_TO_WIN32_HANDLE (fd);
+
+ if (handle != anfd->handle)
+ {
+ unsigned long arg;
+
+ assert (("libev: only socket fds supported in this configuration", ioctlsocket (handle, FIONREAD, &arg) == 0));
+
+ /* handle changed, but fd didn't - we need to do it in two steps */
+ backend_modify (EV_A_ fd, anfd->events, 0);
+ anfd->events = 0;
+ anfd->handle = handle;
+ }
+ }
+ }
+#endif
+
for (i = 0; i < fdchangecnt; ++i)
{
int fd = fdchanges [i];
@@ -987,16 +1012,6 @@ fd_reify (EV_P)
anfd->reify = 0;
-#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP
- if (o_reify & EV__IOFDSET)
- {
- unsigned long arg;
- anfd->handle = EV_FD_TO_WIN32_HANDLE (fd);
- assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0));
- printf ("oi %d %x\n", fd, anfd->handle);//D
- }
-#endif
-
/*if (expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */
{
anfd->events = 0;
@@ -2195,7 +2210,7 @@ timers_reify (EV_P)
#if EV_PERIODIC_ENABLE
-inline_speed
+inline_speed void
periodic_recalc (EV_P_ ev_periodic *w)
{
/* TODO: use slow but potentially more correct incremental algo, */