make 4-arg win32_select() sleep more reasonably on false values
authorBlair Zajac <blair@orcaware.com>
Wed, 1 Jul 1998 19:25:56 +0000 (12:25 -0700)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 4 Jul 1998 05:37:29 +0000 (05:37 +0000)
Message-Id: <199807020225.TAA18740@gobi.gps.caltech.edu>
Date: Wed, 1 Jul 1998 19:25:56 -0700 (PDT)
Subject: [PATCH 5.004_69] select dumps core on MSWin32-x86
--
Message-Id: <199807030107.SAA08595@gobi.gps.caltech.edu>
Date: Thu, 2 Jul 1998 18:07:19 -0700 (PDT)
Subject: [PATCH 5.004_69] select dumps core on MSWin32-x86

p4raw-id: //depot/perl@1303

win32/win32sck.c

index 74af5d7..8929ea7 100644 (file)
@@ -310,8 +310,11 @@ win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr, Perl_fd_set* ex, const
      * 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 */
+       if (timeout)
+           Sleep(timeout->tv_sec  * 1000 +
+                 timeout->tv_usec / 1000);     /* do the best we can */
+       else
+           Sleep(UINT_MAX);
        return 0;
     }
     StartSockets();