summaryrefslogtreecommitdiff
path: root/ext/Storable
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-03 15:11:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-03 15:11:27 +0000
commit6e0ac6f5177957654051738d96367474eaf6e29a (patch)
tree431e45877c57d4fe796ca5624b501bcae7458956 /ext/Storable
parent718526ec3e14f76c12139803b281d8a8e8c8bd21 (diff)
downloadperl-6e0ac6f5177957654051738d96367474eaf6e29a.tar.gz
Update to Storable 1.0.13.
p4raw-id: //depot/perl@11845
Diffstat (limited to 'ext/Storable')
-rw-r--r--ext/Storable/ChangeLog9
-rw-r--r--ext/Storable/Storable.pm13
-rw-r--r--ext/Storable/Storable.xs8
3 files changed, 22 insertions, 8 deletions
diff --git a/ext/Storable/ChangeLog b/ext/Storable/ChangeLog
index 3f07731713..dc71fe5e55 100644
--- a/ext/Storable/ChangeLog
+++ b/ext/Storable/ChangeLog
@@ -1,3 +1,12 @@
+Tue Aug 28 23:53:20 MEST 2001 Raphael Manfredi <Raphael_Manfredi@pobox.com>
+
+. Description:
+
+ Fixed truncation race with lock_retrieve() in lock_store().
+ The file has to be truncated only once the exclusive lock is held.
+
+ Removed spurious debugging messages in .xs file.
+
Sun Jul 1 13:27:32 MEST 2001 Raphael Manfredi <Raphael_Manfredi@pobox.com>
. Description:
diff --git a/ext/Storable/Storable.pm b/ext/Storable/Storable.pm
index 6bc2a752ce..ba8c0f67d6 100644
--- a/ext/Storable/Storable.pm
+++ b/ext/Storable/Storable.pm
@@ -1,4 +1,4 @@
-;# $Id: Storable.pm,v 1.0.1.11 2001/07/01 11:22:14 ram Exp $
+;# $Id: Storable.pm,v 1.0.1.12 2001/08/28 21:51:51 ram Exp $
;#
;# Copyright (c) 1995-2000, Raphael Manfredi
;#
@@ -6,6 +6,9 @@
;# in the README file that comes with the distribution.
;#
;# $Log: Storable.pm,v $
+;# Revision 1.0.1.12 2001/08/28 21:51:51 ram
+;# patch13: fixed truncation race with lock_retrieve() in lock_store()
+;#
;# Revision 1.0.1.11 2001/07/01 11:22:14 ram
;# patch12: systematically use "=over 4" for POD linters
;# patch12: updated version number
@@ -63,7 +66,7 @@ package Storable; @ISA = qw(Exporter DynaLoader);
use AutoLoader;
use vars qw($forgive_me $VERSION);
-$VERSION = '1.012';
+$VERSION = '1.013';
*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
#
@@ -172,9 +175,8 @@ sub _store {
logcroak "not a reference" unless ref($self);
logcroak "wrong argument number" unless @_ == 2; # No @foo in arglist
local *FILE;
- open(FILE, ">$file") || logcroak "can't create $file: $!";
- binmode FILE; # Archaic systems...
if ($use_locking) {
+ open(FILE, ">>$file") || logcroak "can't write into $file: $!";
unless (&CAN_FLOCK) {
logcarp "Storable::lock_store: fcntl/flock emulation broken on $^O";
return undef;
@@ -183,7 +185,10 @@ sub _store {
logcroak "can't get exclusive lock on $file: $!";
truncate FILE, 0;
# Unlocking will happen when FILE is closed
+ } else {
+ open(FILE, ">$file") || logcroak "can't create $file: $!";
}
+ binmode FILE; # Archaic systems...
my $da = $@; # Don't mess if called from exception handler
my $ret;
# Call C routine nstore or pstore, depending on network order
diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs
index 3c79eb60c6..f2c0e2bca0 100644
--- a/ext/Storable/Storable.xs
+++ b/ext/Storable/Storable.xs
@@ -3,7 +3,7 @@
*/
/*
- * $Id: Storable.xs,v 1.0.1.9 2001/07/01 11:25:02 ram Exp $
+ * $Id: Storable.xs,v 1.0.1.10 2001/08/28 21:52:14 ram Exp $
*
* Copyright (c) 1995-2000, Raphael Manfredi
*
@@ -11,6 +11,9 @@
* in the README file that comes with the distribution.
*
* $Log: Storable.xs,v $
+ * Revision 1.0.1.10 2001/08/28 21:52:14 ram
+ * patch13: removed spurious debugging messages
+ *
* Revision 1.0.1.9 2001/07/01 11:25:02 ram
* patch12: fixed memory corruption on croaks during thaw()
* patch12: made code compile cleanly with -Wall (Jarkko Hietaniemi)
@@ -1261,9 +1264,6 @@ stcxt_t *parent_cxt;
cxt->prev = parent_cxt;
SET_STCXT(cxt);
- TRACEME(("kbuf has %d bytes at 0x%x", ksiz, kbuf));
- TRACEME(("mbuf has %d bytes at 0x%x", msiz, mbase));
-
ASSERT(!cxt->s_dirty, ("clean context"));
return cxt;