Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / 5.8.0 / sun4-solaris / auto / Storable / _retrieve.al
CommitLineData
86530b38
AT
1# NOTE: Derived from ../../lib/Storable.pm.
2# Changes made here will be lost when autosplit is run again.
3# See AutoSplit.pm.
4package Storable;
5
6#line 307 "../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_retrieve.al)"
7# Internal retrieve routine
8sub _retrieve {
9 my ($file, $use_locking) = @_;
10 local *FILE;
11 open(FILE, $file) || logcroak "can't open $file: $!";
12 binmode FILE; # Archaic systems...
13 my $self;
14 my $da = $@; # Could be from exception handler
15 if ($use_locking) {
16 unless (&CAN_FLOCK) {
17 logcarp "Storable::lock_store: fcntl/flock emulation broken on $^O";
18 return undef;
19 }
20 flock(FILE, LOCK_SH) || logcroak "can't get shared lock on $file: $!";
21 # Unlocking will happen when FILE is closed
22 }
23 eval { $self = pretrieve(*FILE) }; # Call C routine
24 close(FILE);
25 logcroak $@ if $@ =~ s/\.?\n$/,/;
26 $@ = $da;
27 return $self;
28}
29
30# end of Storable::_retrieve
311;