Subject: | [Fix] Win32 compatability + diff |
The consistant failure to install this module on Win32-based systems[1]
is due to the port's lacking required Fcntl macros; This is a known flaw
[2][3]. The attached .diff has been tested on ActiveState's 5.8.8 build
for MSWin32-x86-multi-thread and makes use of the work-around provided
by the 2nd and 3rd links.
-
Links:
[1] http://cpantesters.perl.org/show/IO-Multiplex.html#IO-Multiplex-1.08
[2] http://perlmonks.org/?node_id=529812
[3] http://rt.cpan.org/Public/Bug/Display.html?id=11938
Subject: | IO-Multiplex.diff |
279a280,282
> };
> if($^O eq q{MSWin32}){
> sub EWOULDBLOCK { return 10035 }
636,641c639,646
< next if
< $! == EINTR ||
< $! == EAGAIN ||
< $! == EWOULDBLOCK;
< warn "IO::Multiplex read error: $!"
< if $! != ECONNRESET;
---
> next
> if $! == EINTR
> || $! == EAGAIN
> || $! == EWOULDBLOCK;
>
> # WSAEFAULT|10014
> warn "IO::Multiplex read error: $!|" . int($!)
> if $! != ECONNRESET;
920,924c925,935
< my $fh = shift;
< my $flags = fcntl($fh, F_GETFL, 0)
< or die "fcntl F_GETFL: $!\n";
< fcntl($fh, F_SETFL, $flags | O_NONBLOCK)
< or die "fcntl F_SETFL $!\n";
---
> my ($fh) = @_;
> if ($^O eq q{MSWin32}) {
> ioctl($fh, 0x8004667e, 1);
> }
> else {
> my $flags = fcntl($fh, F_GETFL, 0)
> or die "fcntl F_GETFL: $!\n";
> fcntl($fh, F_SETFL, $flags | O_NONBLOCK)
> or die "fcntl F_SETFL $!\n";
> }
> return;
926a938
>
1078d1089
<