From: rkinyon Date: Wed, 1 Mar 2006 19:09:54 +0000 (+0000) Subject: close() is now close_fh() X-Git-Tag: 0-99_01~100 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d1b8be9d682c3e0e2397bcf5cfc24f6f0f3a4a1;p=dbsrgits%2FDBM-Deep.git close() is now close_fh() --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 533fe30..edb34d7 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -181,7 +181,7 @@ sub lock { # double-check file inode, in case another process # has optimize()d our file while we were waiting. if ($stats[1] != $self->_root->{inode}) { - $self->{engine}->close( $self ); + $self->{engine}->close_fh( $self ); $self->{engine}->setup_fh( $self ); flock($self->_fh, $type); # re-lock @@ -366,7 +366,7 @@ sub optimize { # with a soft copy. ## $self->unlock(); - $self->{engine}->close( $self ); + $self->{engine}->close_fh( $self ); } if (!rename $self->_root->{file} . '.tmp', $self->_root->{file}) { @@ -376,7 +376,7 @@ sub optimize { } $self->unlock(); - $self->{engine}->close( $self ); + $self->{engine}->close_fh( $self ); $self->{engine}->setup_fh( $self ); return 1; diff --git a/lib/DBM/Deep/Engine.pm b/lib/DBM/Deep/Engine.pm index 4d82646..b21dd6d 100644 --- a/lib/DBM/Deep/Engine.pm +++ b/lib/DBM/Deep/Engine.pm @@ -108,7 +108,7 @@ sub open { my $self = shift; my ($obj) = @_; - if (defined($obj->_fh)) { $self->close( $obj ); } + if (defined($obj->_fh)) { $self->close_fh( $obj ); } eval { local $SIG{'__DIE__'}; @@ -165,7 +165,7 @@ sub open { # Check signature was valid ## unless ($signature eq DBM::Deep->SIG_FILE) { - $self->close( $obj ); + $self->close_fh( $obj ); return $obj->_throw_error("Signature not found -- file is not a Deep DB"); } @@ -187,7 +187,7 @@ sub open { return 1; } -sub close { +sub close_fh { my $self = shift; my $obj = shift; diff --git a/t/23_misc.t b/t/23_misc.t index 5a6f179..59e4aca 100644 --- a/t/23_misc.t +++ b/t/23_misc.t @@ -33,7 +33,7 @@ throws_ok { file => 't/test.db', locking => 1, ); - $db->_get_self->{engine}->close( $db->_get_self ); + $db->_get_self->{engine}->close_fh( $db->_get_self ); ok( !$db->lock ); } @@ -43,6 +43,6 @@ throws_ok { locking => 1, ); $db->lock; - $db->_get_self->{engine}->close( $db->_get_self ); + $db->_get_self->{engine}->close_fh( $db->_get_self ); ok( !$db->unlock ); }