Benjamin J. Tilly [Fri, 26 Mar 2004 21:02:19 +0000 (21:02 +0000)]
From: "Benjamin J. Tilly" (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.8-27986-82842.3.
55447645581215@perl.org>
The forked child should make sure STDIN and STDOUT aren't tied
before messing with them
p4raw-id: //depot/perl@22609
$kidpid = $do_spawn ? -1 : xfork;
if ($kidpid == 0) { # Kid
+ # A tie in the parent should not be allowed to cause problems.
+ untie *STDIN;
+ untie *STDOUT;
# If she wants to dup the kid's stderr onto her stdout I need to
# save a copy of her stdout before I put something else there.
if ($dad_rdr ne $dad_err && $dup_err