Make non-blocking mode work on Windows in IO::Socket::INET
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Thu, 26 Feb 2009 08:09:33 +0000 (09:09 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 15 Apr 2009 13:30:59 +0000 (14:30 +0100)
CPAN RT bug #43573

(cherry picked from commit 20caf59dc5a2137cdf1de6dae458da063417a8d2)

ext/IO/IO.pm
ext/IO/IO.xs

index ac06642..5f42651 100644 (file)
@@ -7,7 +7,7 @@ use Carp;
 use strict;
 use warnings;
 
-our $VERSION = "1.23_01";
+our $VERSION = "1.23_02";
 XSLoader::load 'IO', $VERSION;
 
 sub import {
index c81cb93..7d0d4db 100644 (file)
@@ -121,7 +121,12 @@ io_blocking(pTHX_ InputStream f, int block)
     }
     return RETVAL;
 #else
+#   ifdef WIN32
+    unsigned long flags = block;
+    return ioctl(PerlIO_fileno(f), FIONBIO, &flags);
+#   else
     return -1;
+#   endif
 #endif
 }