From: Kurt Zeilenga Date: Mon, 7 Aug 2000 19:46:37 +0000 (+0000) Subject: Add support for Sleepycat Berkeley DB 3.1 (ITS#649) X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2305 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=063691aec09f4ec584f7004bcc443c8d6c3dac75;p=openldap Add support for Sleepycat Berkeley DB 3.1 (ITS#649) changes derived from Ian Logan's patch --- diff --git a/build/openldap.m4 b/build/openldap.m4 index a12b0a2577..2db4042fb0 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -317,14 +317,17 @@ main() int rc; u_int32_t flags = DB_CREATE | DB_THREAD; - #if DB_VERSION_MAJOR > 2 DB_ENV *env = NULL; rc = db_env_create( &env, 0 ); if( rc == 0 ) { +#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) + rc = env->open( env, NULL, flags, 0 ); +#else rc = env->open( env, NULL, NULL, flags, 0 ); +#endif } #else @@ -336,6 +339,13 @@ main() if( rc == 0 ) { db_appexit( &env ); } +#endif +#if DB_VERSION_MAJOR > 2 +#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) + env->remove( env, NULL, DB_FORCE); +#else + env->remove( env, NULL, NULL, DB_FORCE); +#endif #endif return rc; diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index 8b857f630d..951e06b276 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -145,12 +145,17 @@ int ldbm_initialize( void ) return( 1 ); } -#if DB_VERSION_MAJOR >= 3 +#if DB_VERSION_MAJOR > 2 ldbm_Env->set_errcall( ldbm_Env, ldbm_db_errcall ); ldbm_Env->set_errpfx( ldbm_Env, "==>" ); envFlags |= DB_INIT_MPOOL; + +#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) + err = ldbm_Env->open( ldbm_Env, NULL, envFlags, 0 ); +#else err = ldbm_Env->open( ldbm_Env, NULL, NULL, envFlags, 0 ); +#endif if ( err != 0 ) { char error[BUFSIZ]; @@ -175,7 +180,7 @@ int ldbm_shutdown( void ) if( !ldbm_initialized ) return 1; #if DB_VERSION_MAJOR >= 3 - ldbm_Env->close( ldbm_Env, 0 ); + ldbm_Env->close( ldbm_Env, 0 ); #else db_appexit( ldbm_Env ); #endif @@ -253,8 +258,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) memset( &dbinfo, '\0', sizeof( dbinfo )); -#if defined( DB_VERSION_MAJOR ) && defined( DB_VERSION_MINOR ) && \ - DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 4 +#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 4 /* * BerkeleyDB 2.4 do not allow db_cachesize * to be specified if an DB_ENV is.