*/
maxfd = fd + 1;
tv.tv_sec = msecs / 1000;
- tv.tv_usec = msecs % 1000;
+ tv.tv_usec = (msecs % 1000) * 1000;
while ((ready = select(maxfd, &rfd, NULL, NULL, &tv)) < 0 ) {
if (errno != EINTR ) {
DWORD rc;
HANDLE hFile = (HANDLE)_get_osfhandle(fd);
- rc = MsgWaitForMultipleObjects( 1,
- &hFile,
- FALSE, /* wait all */
- msecs, /*millisecs*/
- QS_ALLEVENTS);
+ rc = WaitForMultipleObjects( 1,
+ &hFile,
+ TRUE, /* wait all */
+ msecs); /*millisecs*/
/* 1 => Input ready, 0 => not ready, -1 => error */
switch (rc) {