From: Stephen McCamant Date: Tue, 9 Jan 2001 13:33:22 +0000 (-0800) Subject: Remove FileHandle/IO dependence in t/io/openpid.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d27127a1d94bb72eb9421f343c9c3c2c5ca60b5a;p=p5sagit%2Fp5-mst-13.2.git Remove FileHandle/IO dependence in t/io/openpid.t Message-ID: <14939.33475.474459.147429@soda.csua.berkeley.edu> p4raw-id: //depot/perl@8383 --- diff --git a/t/io/openpid.t b/t/io/openpid.t index 3871e0b..7c04a29 100755 --- a/t/io/openpid.t +++ b/t/io/openpid.t @@ -16,10 +16,8 @@ BEGIN { } } - -use FileHandle; use Config; -autoflush STDOUT 1; +$| = 1; $SIG{PIPE} = 'IGNORE'; print "1..10\n"; @@ -33,10 +31,8 @@ $perl = qq[$^X "-I../lib"]; # the other reader reads one line, waits a few seconds and then # exits to test the waitpid function. # -$cmd1 = qq/$perl -e "use FileHandle; autoflush STDOUT 1; / . - qq/print qq[first process\\n]; sleep 30;"/; -$cmd2 = qq/$perl -e "use FileHandle; autoflush STDOUT 1; / . - qq/print qq[second process\\n]; sleep 30;"/; +$cmd1 = qq/$perl -e "\$|=1; print qq[first process\\n]; sleep 30;"/; +$cmd2 = qq/$perl -e "\$|=1; print qq[second process\\n]; sleep 30;"/; $cmd3 = qq/$perl -e "print <>;"/; # hangs waiting for end of STDIN $cmd4 = qq/$perl -e "print scalar <>;"/; @@ -76,7 +72,8 @@ print "not " unless $kill_cnt == 2; print "ok 8\n"; # send one expected line of text to child process and then wait for it -autoflush FH4 1; +select(FH4); $| = 1; select(STDOUT); + print FH4 "ok 9\n"; print "# waiting for process $pid4 to exit\n"; $reap_pid = waitpid $pid4, 0;