Skip to content

Commit

Permalink
Fix mangled stdio checks. This one passes all tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed May 3, 2011
1 parent 96afc60 commit e6887bd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/POE/Wheel/Run.pm
Expand Up @@ -256,16 +256,15 @@ sub new {
);
}

# # Did the user mangle stdio?
# # TODO - This means well, but it doesn't realy work.
# unless (ref($program) eq 'CODE') {
# croak "Someone has closed or moved STDIN... exec() won't find it"
# unless fileno(STDIN) or fileno(STDIN) != 0;
# croak "Someone has closed or moved STDOUT... exec() won't find it"
# unless fileno(STDOUT) or fileno(STDOUT) != 1;
# croak "Someone has closed or moved STDERR... exec() won't find it"
# unless fileno(STDERR) or fileno(STDERR) != 2;
# }
# Did the user mangle stdio?
unless (ref($program) eq 'CODE') {
croak "Someone has closed or moved STDIN... exec() won't find it"
unless defined fileno(STDIN) && fileno(STDIN) == 0;
croak "Someone has closed or moved STDOUT... exec() won't find it"
unless tied(*STDOUT) || defined fileno(STDOUT) && fileno(STDOUT) == 1;
croak "Someone has closed or moved STDERR... exec() won't find it"
unless tied(*STDERR) || defined fileno(STDERR) && fileno(STDERR) == 2;
}

my (
$stdin_read, $stdout_write, $stdout_read, $stdin_write,
Expand Down

0 comments on commit e6887bd

Please sign in to comment.