From: Jarkko Hietaniemi Date: Fri, 17 Sep 1999 18:19:18 +0000 (+0000) Subject: Take away the infamous io/dup.t #7. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7a02c4fb533bb0a7ae92f82a4a660045d95669a;p=p5sagit%2Fp5-mst-13.2.git Take away the infamous io/dup.t #7. It seems there simply is no way to portably "flush" an input file handle. p4raw-id: //depot/cfgperl@4176 --- diff --git a/doio.c b/doio.c index 0b1cdd1..793b540 100644 --- a/doio.c +++ b/doio.c @@ -283,17 +283,8 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } if (IoIFP(thatio)) { PerlIO *fp = IoIFP(thatio); - /* Flush stdio buffer before dup. --mjd - * Unfortunately SEEK_CURing 0 seems to - * be optimized away on most platforms; - * only Solaris and Linux seem to flush - * on that. --jhi */ + /* Flush stdio buffer before dup */ PerlIO_seek(fp, 0, SEEK_CUR); - /* On the other hand, do all platforms - * take gracefully to flushing a read-only - * filehandle? Perhaps we should do - * fsetpos(src)+fgetpos(dst)? --nik */ - PerlIO_flush(fp); fd = PerlIO_fileno(fp); if (IoTYPE(thatio) == 's') IoTYPE(io) = 's'; diff --git a/t/io/dup.t b/t/io/dup.t index 9ad823f..af13d4d 100755 --- a/t/io/dup.t +++ b/t/io/dup.t @@ -2,7 +2,7 @@ # $RCSfile: dup.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:27 $ -print "1..7\n"; +print "1..6\n"; print "ok 1\n"; @@ -38,16 +38,3 @@ unlink 'Io.dup'; print STDOUT "ok 6\n"; -# 7 # 19990811 mjd@plover.com -my ($out1, $out2) = ("Line 1\n", "Line 2\n"); -open(W, "> Io.dup") || die "Can't open stdout"; -print W $out1, $out2; -close W; -open(R1, "< Io.dup") || die "Can't read temp file"; -$in1 = ; -open(R2, "<&R1") || die "Can't dup"; -$in2 = ; -print "not " unless $in1 eq $out1 && $in2 eq $out2; -print "ok 7\n"; - -unlink("Io.dup");