Skip to content

Commit b9540c2

Browse files
piscisaureusry
authored andcommitted
Libev windows fixes
1 parent 6dbf491 commit b9540c2

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

deps/libev/ev.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ fd_reify (EV_P)
984984
unsigned long arg;
985985
anfd->handle = EV_FD_TO_WIN32_HANDLE (fd);
986986
assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0));
987-
printf ("oi %d %x\n", fd, anfd->handle);//D
988987
}
989988
#endif
990989

@@ -1313,12 +1312,12 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
13131312
}
13141313
else
13151314
#endif
1316-
/* win32 people keep sending patches that change this write() to send() */
1317-
/* and then run away. but send() is wrong, it wants a socket handle on win32 */
1318-
/* so when you think this write should be a send instead, please find out */
1319-
/* where your send() is from - it's definitely not the microsoft send, and */
1320-
/* tell me. thank you. */
1321-
write (evpipe [1], &dummy, 1);
1315+
1316+
#ifdef __MINGW32__
1317+
send(EV_FD_TO_WIN32_HANDLE(evpipe [1]), &dummy, 1, 0);
1318+
#else
1319+
write (evpipe [1], &dummy, 1);
1320+
#endif
13221321

13231322
errno = old_errno;
13241323
}
@@ -1341,8 +1340,11 @@ pipecb (EV_P_ ev_io *iow, int revents)
13411340
#endif
13421341
{
13431342
char dummy;
1344-
/* see discussion in evpipe_write when you think this read should be recv in win32 */
1343+
#ifdef __MINGW32__
1344+
recv(EV_FD_TO_WIN32_HANDLE(evpipe [0]), &dummy, 1, 0);
1345+
#else
13451346
read (evpipe [0], &dummy, 1);
1347+
#endif
13461348
}
13471349

13481350
if (sig_pending)

0 commit comments

Comments
 (0)