Skip to content

Commit

Permalink
Item1089: Gilmar found out the issue. <& dups the file with a differe…
Browse files Browse the repository at this point in the history
…nt file descriptor. What we want is <&= that creates another perl filehandle, with the same fileno

git-svn-id: http://svn.foswiki.org/trunk@2526 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Feb 18, 2009
1 parent 2f63e39 commit 64031f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions UnitTestContrib/lib/Unit/CGIEngine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ sub make_request {
my ( $env, $in ) = _req2cgi($req);

# Saving STDIN
open my $stdin, '<&', \*STDIN or die "Can't dup STDIN: $!";
open my $stdin, '<&=', \*STDIN or die "Can't dup STDIN: $!";
close STDIN;

# Redirecting STDIN to the CGI input
open STDIN, '<', $in or die "Can't redirect STDIN to \$in: $!";

# Saving STDOUT
open my $stdout, '>&', \*STDOUT or die "Can't dup STDOUT: $!";
open my $stdout, '>&=', \*STDOUT or die "Can't dup STDOUT: $!";
close STDOUT;
my $out = '';

Expand All @@ -118,11 +118,11 @@ sub make_request {
};

# Restoring STDIN
open STDIN, '<&', $stdin or die "Can't restore STDIN: $!";
open STDIN, '<&=', $stdin or die "Can't restore STDIN: $!";
close $stdin;

# Restoring STDOUT
open STDOUT, '>&', $stdout or die "Can't restore STDOUT: $!";
open STDOUT, '>&=', $stdout or die "Can't restore STDOUT: $!";
close $stdout;
return HTTP::Message->parse($out);
}
Expand Down
4 changes: 0 additions & 4 deletions UnitTestContrib/test/unit/EngineTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ sub list_tests {
print STDERR 'Install libwww-perl in order to run EngineTests', "\n";
return ();
}
# FIXME - when the problem with Emulated Safe Pipes will be solved
print STDERR 'Disabled for now', "\n";
return ();
# End of FIXME
return $this->SUPER::list_tests(@_);
}

Expand Down

0 comments on commit 64031f0

Please sign in to comment.