mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 18:19:52 -05:00
In db_destroy, cannot checkpoint a NULL dbenv.
This commit is contained in:
parent
f2f6c516ab
commit
5c2bc277b8
1 changed files with 11 additions and 10 deletions
|
|
@ -346,18 +346,19 @@ bdb_db_destroy( BackendDB *be )
|
|||
int rc;
|
||||
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
|
||||
|
||||
/* force a checkpoint */
|
||||
if( bdb->bi_txn ) {
|
||||
rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
|
||||
if( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
|
||||
db_strerror(rc), rc, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/* close db environment */
|
||||
if( bdb->bi_dbenv ) {
|
||||
|
||||
/* force a checkpoint */
|
||||
if( bdb->bi_txn ) {
|
||||
rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
|
||||
if( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
|
||||
db_strerror(rc), rc, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 );
|
||||
bdb->bi_dbenv = NULL;
|
||||
if( rc != 0 ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue