summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-04 03:34:36 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-02-04 03:34:36 +0000
commit7e3be867c805de9df8b4e2ab54f88f956419821c (patch)
treebc5ae8928b15195b786db01e25ae38a89c47f655 /win32
parentf2bb5751a12fdd22e724ca263d4e207a6f6e123f (diff)
downloadperl-7e3be867c805de9df8b4e2ab54f88f956419821c.tar.gz
[win32] support win32_select(0,0,0,msec) (winsock doesn't)
p4raw-id: //depot/win32/perl@461
Diffstat (limited to 'win32')
-rw-r--r--win32/win32sck.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/win32/win32sck.c b/win32/win32sck.c
index 8019cc3986..14d2e6a45f 100644
--- a/win32/win32sck.c
+++ b/win32/win32sck.c
@@ -269,6 +269,14 @@ win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr, Perl_fd_set* ex, const
int i, fd, bit, offset;
FD_SET nrd, nwr, nex, *prd, *pwr, *pex;
+ /* winsock seems incapable of dealing with all three null fd_sets,
+ * so do the (millisecond) sleep as a special case
+ */
+ if (!(rd || wr || ex)) {
+ Sleep(timeout->tv_sec * 1000 +
+ timeout->tv_usec / 1000); /* do the best we can */
+ return 0;
+ }
StartSockets();
PERL_FD_ZERO(&dummy);
if (!rd)