#include <ac/stdlib.h>
#include <ac/errno.h>
#include <sys/stat.h>
-#ifdef HAVE_UTIME_H
-# ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-# include <utime.h>
-#endif /* HAVE_UTIME_H */
#include "back-bdb.h"
#include <lutil.h>
#include <ldap_rq.h>
}
/* 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;
}
open_env = 0;
} else {
/* Create a new env that can take the desired settings */
+ if ( bdb->bi_dbenv != NULL ) {
+ 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,