close() is now close_fh()
rkinyon [Wed, 1 Mar 2006 19:09:54 +0000 (19:09 +0000)]
lib/DBM/Deep.pm
lib/DBM/Deep/Engine.pm
t/23_misc.t

index 533fe30..edb34d7 100644 (file)
@@ -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;
index 4d82646..b21dd6d 100644 (file)
@@ -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;
 
index 5a6f179..59e4aca 100644 (file)
@@ -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 );
 }