From: Kurt Zeilenga Date: Mon, 27 Aug 2001 22:06:07 +0000 (+0000) Subject: Add DB 3.3 support... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1155 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fb5df59342eefd248ce9533d99c8f332ca8b5e72;p=openldap Add DB 3.3 support... likely needs work on NT4 (but so did old code) --- diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index a232da13ec..734af29dfa 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -86,7 +86,8 @@ DB_ENV *ldbm_Env = NULL; /* real or fake, depending on db and version */ void * ldbm_malloc( size_t size ) { - return( calloc( 1, size )); + /* likely should use ber_mem* routines */ + return( calloc( 1, size ) ); } #ifdef LDAP_SYSLOG @@ -340,7 +341,14 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize ) } ret->set_pagesize( ret, DEFAULT_DB_PAGE_SIZE ); + + /* likely should use ber_mem* routines */ +#if DB_VERSION_MINOR >= 3 + ret->set_alloc( ret, ldbm_malloc, NULL, NULL ); +#else ret->set_malloc( ret, ldbm_malloc ); +#endif + /* ret->set_cachesize( ret, 0, dbcachesize, 0 ); */ err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);