# 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
# with a soft copy.
##
$self->unlock();
- $self->{engine}->close( $self );
+ $self->{engine}->close_fh( $self );
}
if (!rename $self->_root->{file} . '.tmp', $self->_root->{file}) {
}
$self->unlock();
- $self->{engine}->close( $self );
+ $self->{engine}->close_fh( $self );
$self->{engine}->setup_fh( $self );
return 1;
my $self = shift;
my ($obj) = @_;
- if (defined($obj->_fh)) { $self->close( $obj ); }
+ if (defined($obj->_fh)) { $self->close_fh( $obj ); }
eval {
local $SIG{'__DIE__'};
# 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");
}
return 1;
}
-sub close {
+sub close_fh {
my $self = shift;
my $obj = shift;
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 );
}
locking => 1,
);
$db->lock;
- $db->_get_self->{engine}->close( $db->_get_self );
+ $db->_get_self->{engine}->close_fh( $db->_get_self );
ok( !$db->unlock );
}