From: Steve Peters Date: Sun, 31 Dec 2006 16:37:54 +0000 (+0000) Subject: Fix to test failures caused by change #29606 when PERLIO=stdio. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=054149a8968eff13946521ef29d0987fadd9a28b;p=p5sagit%2Fp5-mst-13.2.git Fix to test failures caused by change #29606 when PERLIO=stdio. Based on suggestions from Ilya Zakharevich in http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-12/msg00646.html p4raw-link: @29606 on //depot/perl: add1a1a3c3dc28dd49272f4754cfc04acae28e3b p4raw-id: //depot/perl@29646 --- diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 0c2daeb..a71c68c 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -61,10 +61,12 @@ sub _load_stubs { croak("$callpack doesn't contain an __DATA__ token") unless defined fileno($fh); # Protect: fork() shares the file pointer between the parent and the kid - open my $nfh, '<&', $fh or croak "reopen: $!";# dup() the fd - close $fh or die "close: $1"; # autocloses, but be paranoid - open $fh, '<&', $nfh or croak "reopen2: $!"; # dup() the fd "back" - close $nfh or die "close after reopen: $1"; # autocloses, but be paranoid + if(sysseek($fh, tell($fh), 0)) { + open my $nfh, '<&', $fh or croak "reopen: $!";# dup() the fd + close $fh or die "close: $1"; # autocloses, but be paranoid + open $fh, '<&', $nfh or croak "reopen2: $!"; # dup() the fd "back" + close $nfh or die "close after reopen: $1"; # autocloses, but be paranoid + } $Cache{"${currpack}::