projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
poll: do not return 0 on timeout=-1
[gnulib.git]
/
lib
/
poll.c
diff --git
a/lib/poll.c
b/lib/poll.c
index
8ce68c0
..
e064565
100644
(file)
--- a/
lib/poll.c
+++ b/
lib/poll.c
@@
-452,6
+452,7
@@
poll (struct pollfd *pfd, nfds_t nfd, int timeout)
if (!hEvent)
hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
+restart:
handle_array[0] = hEvent;
nhandles = 1;
FD_ZERO (&rfds);
@@
-592,6
+593,12
@@
poll (struct pollfd *pfd, nfds_t nfd, int timeout)
rc++;
}
+ if (!rc && timeout == INFTIM)
+ {
+ SwitchToThread();
+ goto restart;
+ }
+
return rc;
#endif
}