diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-12-31 16:37:54 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-12-31 16:37:54 +0000 |
commit | 054149a8968eff13946521ef29d0987fadd9a28b (patch) | |
tree | 3b34058ef5b894c9d2c43338f399fb9db4d660cb /lib/SelfLoader.pm | |
parent | 714c8e96dde801b3b2e73fc130d02c78db1eb06f (diff) | |
download | perl-054149a8968eff13946521ef29d0987fadd9a28b.tar.gz |
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
Diffstat (limited to 'lib/SelfLoader.pm')
-rw-r--r-- | lib/SelfLoader.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 0c2daebc83..a71c68c456 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}::<DATA"} = 1; # indicate package is cached local($/) = "\n"; |