Subject: | Two AIX-Related bugs |
There are two bugs in IPC::Run which affect it's interaction with IO::Pty under AIX.
The first bug is identical to the bug in FreeBSD which causes the first block of pty tests to fail. That bug has not been fixed in this patch; the same test-skip logic has been applied when running under AIX.
The second bug involves the fact that AIX does not correctly report EOF when handling PTY's. I noticed that you have a catch for Win32 for this as well; logic has been added to correctly detect PTY EOF when running under AIX.
Thanks for the extremely handy module,
Tyler
diff -dur IPC-Run-0.78.orig/lib/IPC/Run.pm IPC-Run/lib/IPC/Run.pm
--- IPC-Run-0.78.orig/lib/IPC/Run.pm 2004-11-05 13:47:47.000000000 -0800
+++ IPC-Run/lib/IPC/Run.pm 2004-11-05 13:48:05.000000000 -0800
@@ -2397,7 +2397,8 @@
## read() throws the bad file descriptor message if the
## kid dies on Win32.
die $@ unless
- $@ =~ /^Input\/output error: read/
+ $@ =~ /^Input\/output error: read/ ||
+ ($@ =~ /input or output/ && $^O =~ /aix/)
|| ( Win32_MODE && $@ =~ /Bad file descriptor/ ) ;
}
diff -dur IPC-Run-0.78.orig/t/pty.t IPC-Run/t/pty.t
--- IPC-Run-0.78.orig/t/pty.t 2004-11-05 13:47:47.000000000 -0800
+++ IPC-Run/t/pty.t 2004-11-05 13:48:05.000000000 -0800
@@ -86,6 +86,7 @@
my $exp ;
my $freebsd = $^O =~ /freebsd/ ? "freebsd deadlocks on this test" : "" ;
+my $aix = $^O =~ /aix/ ? "this does does not work on AIX" : "" ;
my @tests = (
##
@@ -93,6 +94,7 @@
##
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
$out = 'REPLACE ME' ;
$? = 99 ;
$fd_map = _map_fds ;
@@ -105,16 +107,19 @@
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
$exp = qr/^HELLO\n(?!\n)$/ ;
$err =~ $exp ? ok( 1 ) : ok( $err, $exp ) ;
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
ok( $in, '' )
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
$in = "world\n" ;
$? = 0 ;
pump $h until $out =~ /world/ && $err =~ /WORLD/ ;
@@ -122,25 +127,30 @@
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
$exp = qr/^HELLO\nWORLD\n(?!\n)$/ ;
$err =~ $exp ? ok( 1 ) : ok( $err, $exp ) ;
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
ok( $in, '' )
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
$in = "quit\n" ;
ok( $h->finish ) ;
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
ok( ! $? )
},
sub {
return skip $freebsd, 1 if $freebsd;
+ return skip $aix, 1 if $aix;
ok( _map_fds, $fd_map )
},