X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=cbits%2FinputReady.c;h=30e140b89c4452cf1fa8a9b7a26ebbcd7494271d;hb=7e8c7becf29c0fd359ff7e205b60df3ef4b920fb;hp=5b1e005ed4a1d4c1c8ac056a16683112b2def8cf;hpb=b2e1bc7e50a23d746911ce8eaf75debcfb366f17;p=ghc-base.git diff --git a/cbits/inputReady.c b/cbits/inputReady.c index 5b1e005..30e140b 100644 --- a/cbits/inputReady.c +++ b/cbits/inputReady.c @@ -34,7 +34,7 @@ inputReady(int fd, int msecs, int isSock) */ 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 ) { @@ -50,11 +50,10 @@ inputReady(int fd, int msecs, int isSock) 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) {