Subject: | run hangs in select call on solaris platform |
Date: | Thu, 16 Jun 2011 10:23:27 +0000 |
To: | "bug-IPC-Run [...] rt.cpan.org" <bug-IPC-Run [...] rt.cpan.org> |
From: | "Coppieters, Pauwel" <pauwel.coppieters [...] hp.com> |
Hello,
I found the following behaviour for IPC::RUN-0:89
on SunOS 5.10 sun4v sparc SUNW,Sun-Fire-T200
perl5 (revision 5 version 8 subversion 4)
In the module RUN.pm you have the piece of code near line 3030:
my $nfound;
unless ( Win32_MODE ) {
$nfound = select(
$self->{ROUT} = $self->{RIN},
$self->{WOUT} = $self->{WIN},
$self->{EOUT} = $self->{EIN},
$timeout
);
}
else {
If in RIN, WIN and EIN there are no file descriptors at all, the select returns after $timeout
seconds with $nfound = 0. This is correct, but the timeout is annoying.
I replaced this code with :
my $bitsr = unpack("b*", $self->{RIN});
my $bitsw = unpack("b*", $self->{WIN});
my $bitse = unpack("b*", $self->{EIN});
if ($bitsr eq '0000000000000000' && $bitsw eq '00000000' && $bitse eq '') {
$nfound = select(
$self->{ROUT} = $self->{RIN},
$self->{WOUT} = $self->{WIN},
$self->{EOUT} = $self->{EIN},
1
);
}
else {
$nfound = select(
$self->{ROUT} = $self->{RIN},
$self->{WOUT} = $self->{WIN},
$self->{EOUT} = $self->{EIN},
$timeout);
}
Not very sophisticated, but for the time being it works.
Kind regards,
Pauwel