diff options
author | Peter J. Farley III <pjfarley@banet.net> | 2000-10-22 16:00:00 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-23 03:57:36 +0000 |
commit | f567092be6d7737ea96c13c4f1f37e9234e6c024 (patch) | |
tree | 9aff735aef0572b7a6d9b6fa343637af58f22833 /ext/Storable | |
parent | 1d76c68a4334730dcff690b6e52f049c381854c5 (diff) | |
download | perl-f567092be6d7737ea96c13c4f1f37e9234e6c024.tar.gz |
Avoid Storable locking on DJGPP for now.
Subject: [PATCH] Re: [ID 20001020.009] Not OK: perl v5.7.0 +DEVEL7368 on dos-djgpp djgpp
Message-Id: <4.3.1.0.20001022194247.00acfee0@pop5.banet.net>
p4raw-id: //depot/perl@7409
Diffstat (limited to 'ext/Storable')
-rw-r--r-- | ext/Storable/Storable.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/Storable/Storable.pm b/ext/Storable/Storable.pm index 76c320923b..aada65eea5 100644 --- a/ext/Storable/Storable.pm +++ b/ext/Storable/Storable.pm @@ -118,6 +118,11 @@ sub _store { open(FILE, ">$file") || logcroak "can't create $file: $!"; 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; + } flock(FILE, LOCK_EX) || logcroak "can't get exclusive lock on $file: $!"; truncate FILE, 0; @@ -234,7 +239,13 @@ sub _retrieve { my $self; my $da = $@; # Could be from exception handler if ($use_locking) { - flock(FILE, LOCK_SH) || logcroak "can't get shared lock on $file: $!"; + 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: $!"; # Unlocking will happen when FILE is closed } eval { $self = pretrieve(*FILE) }; # Call C routine |