From: Kurt Zeilenga Date: Mon, 3 Sep 2001 19:23:05 +0000 (+0000) Subject: Do version checks for BDB 3 or greater X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1130 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65686b72fd35da41744aa281aa71138f63e26408;p=openldap Do version checks for BDB 3 or greater --- diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index 2b40fd5eda..f230d8e2e8 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -102,8 +102,6 @@ ldbm_db_errcall( const char *prefix, char *message ) #endif } -#if DB_VERSION_MAJOR < 3 - int ldbm_initialize( const char* home ) { int err; @@ -134,6 +132,7 @@ int ldbm_initialize( const char* home ) } } +#if DB_VERSION_MAJOR < 3 #ifndef HAVE_BERKELEY_DB_THREAD ldap_pvt_thread_mutex_init( &ldbm_big_mutex ); #endif @@ -174,6 +173,7 @@ int ldbm_initialize( const char* home ) #endif return( 1 ); } +#endif return 0; } @@ -182,35 +182,17 @@ int ldbm_shutdown( void ) { if( !ldbm_initialized ) return 1; +#if DB_VERSION_MAJOR < 3 db_appexit( ldbm_Env ); #ifndef HAVE_BERKELEY_DB_THREAD ldap_pvt_thread_mutex_destroy( &ldbm_big_mutex ); +#endif #endif return 0; } -#else /* Berkeley v3 or greater */ - - -int ldbm_initialize( const char * home ) -{ - /* v3 uses ldbm_initialize_env */ - return 0; -} - - -int ldbm_shutdown( void ) -{ - return 0; -} - - -#endif - - - #else /* some DB other than Berkeley V2 or greater */ int ldbm_initialize( const char * home ) @@ -236,7 +218,6 @@ int ldbm_shutdown( void ) #if defined( HAVE_BERKELEY_DB ) && (DB_VERSION_MAJOR >= 3) - DB_ENV *ldbm_initialize_env(const char *home, int dbcachesize, int *envdirok) { DB_ENV *env = NULL; @@ -315,7 +296,6 @@ void ldbm_shutdown_env(DB_ENV *env) { } - #endif