]> git.sur5r.net Git - openldap/commitdiff
Must close env before removing it.
authorHoward Chu <hyc@openldap.org>
Thu, 25 Aug 2005 03:00:29 +0000 (03:00 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 25 Aug 2005 03:00:29 +0000 (03:00 +0000)
servers/slapd/back-bdb/init.c

index 014ed2d30a4389d459e8289fab540253b256934e..33ef87d559249344e0cba3acc4ac78b0dc24d6eb 100644 (file)
@@ -278,6 +278,15 @@ bdb_db_open( BackendDB *be )
                        }
                        /* Prev environment had TXN support, get rid of it */
                        if ( !flags_ok ) {
+                               bdb->bi_dbenv->close( bdb->bi_dbenv, 0 );
+                               bdb->bi_dbenv = NULL;
+                               rc = db_env_create( &bdb->bi_dbenv, 0 );
+                               if( rc != 0 ) {
+                                       Debug( LDAP_DEBUG_ANY,
+                                               "bdb_db_open: db_env_create failed: %s (%d)\n",
+                                               db_strerror(rc), rc, 0 );
+                                       return rc;
+                               }
                                bdb->bi_dbenv->remove( bdb->bi_dbenv, dbhome, 0 );
                                bdb->bi_dbenv = NULL;
                        }