Subject: | Bug in expect 1.21 |
Date: | Tue, 23 Jun 2009 13:01:34 +0300 |
To: | bug-Expect [...] rt.cpan.org |
From: | Tomi Leppikangas <tomilepp [...] sun3.oulu.fi> |
Hi,
I moved on of our web application from apache 1.3 to 2.2
and run to problems with Expect.pm.
I debugged problem and notised that STDIN from forked
child is not working right.
I have read similar reports about mod_perl. Usually
there is problem with unclosed or untied STDIN/STDOUT.
I managed to get it working by adding one more close to
Expect.pm
Here is diff for Expect 1.21:
--- /root/.cpan/build/Expect-1.21/Expect.pm 2007-07-19 15:23:51.000000000 +0300
+++ /usr/lib/perl5/site_perl/5.8.8/Expect.pm 2009-06-23 12:57:59.000000000 +0300
@@ -157,6 +157,7 @@
die "Cannot sync with parent: $!" if not defined $errstatus;
close FROM_PARENT;
+ POSIX::close(1);
close(STDIN);
open(STDIN,"<&". $slv->fileno())
or die "Couldn't reopen STDIN for reading, $!\n";
--
## tomilepp cc oulu fi ##
## http://www.student.oulu.fi/~tomilepp/ ##