use AutoLoader;
use vars qw($forgive_me $VERSION);
-$VERSION = '1.003';
+$VERSION = '1.004';
*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
#
require Carp;
Carp::croak(@_);
}
+ sub logcarp {
+ require Carp;
+ Carp::carp(@_);
+ }
};
}
}
sub logcroak;
+sub logcarp;
sub retrieve_fd { &fd_retrieve } # Backward compatibility
binmode FILE; # Archaic systems...
if ($use_locking) {
if ($^O eq 'dos') {
- require Carp;
- Carp::carp "Storable::lock_store: fcntl/flock emulation broken on $^O\n";
- return undef;
+ logcarp "Storable::lock_store: fcntl/flock emulation broken on $^O";
+ return undef;
}
flock(FILE, LOCK_EX) ||
logcroak "can't get exclusive lock on $file: $!";
my $self;
my $da = $@; # Could be from exception handler
if ($use_locking) {
- if ($^O eq 'dos') {
- require Carp;
- Carp::carp "Storable::lock_retrieve: fcntl/flock emulation broken on $^O\n";
- return undef;
- }
- flock(FILE, LOCK_SH) ||
- logcroak "can't get shared lock on $file: $!";
+ if ($^O eq 'dos') {
+ logcarp "Storable::lock_store: fcntl/flock emulation broken on $^O";
+ return undef;
+ }
+ flock(FILE, LOCK_SH) || logcroak "can't get shared lock on $file: $!";
# Unlocking will happen when FILE is closed
}
eval { $self = pretrieve(*FILE) }; # Call C routine
#!./perl
-# $Id: lock.t,v 1.0.1.1 2000/09/28 21:44:06 ram Exp $
+# $Id: lock.t,v 1.0.1.2 2000/10/23 18:03:07 ram Exp ram $
#
# @COPYRIGHT@
#
# $Log: lock.t,v $
+# Revision 1.0.1.2 2000/10/23 18:03:07 ram
+# patch4: protected calls to flock() for dos platform
+#
# Revision 1.0.1.1 2000/09/28 21:44:06 ram
# patch2: created.
#
#
+use Config;
+
+if ($Config{'osname'} eq 'dos') {
+ print "1..0 # Skip: fcntl/flock emulation broken on this platform\n";
+ exit 0;
+}
+
sub BEGIN {
chdir('t') if -d 't';
- @INC = '.';
+ @INC = '.';
push @INC, '../lib';
require Config; import Config;
if ($Config{'extensions'} !~ /\bStorable\b/) {
print "1..0 # Skip: no flock or flock emulation on this platform\n";
exit 0;
}
- if ($Config{'osname'} eq 'dos') {
- print "1..0 # Skip: fcntl/flock emulation broken on this platform\n";
- exit 0;
- }
require 'lib/st-dump.pl';
}