From: Kurt Zeilenga Date: Thu, 7 Jan 1999 03:28:08 +0000 (+0000) Subject: Wrap db2 mutex with -DHAVE_BERKELEY_DB2 (should be hidden in -lldbm) ITS#35 X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~812 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b815f61e0d380cb9d70cac70cad0ef04e09b9af1;p=openldap Wrap db2 mutex with -DHAVE_BERKELEY_DB2 (should be hidden in -lldbm) ITS#35 Unwrap ldbm_datum_init() --- diff --git a/servers/slapd/back-ldbm/id2children.c b/servers/slapd/back-ldbm/id2children.c index 171e6c2618..aa8a79cecd 100644 --- a/servers/slapd/back-ldbm/id2children.c +++ b/servers/slapd/back-ldbm/id2children.c @@ -23,12 +23,7 @@ id2children_add( IDList *idl; char buf[20]; -#ifdef HAVE_BERKELEY_DB2 - Datum data; - ldbm_datum_init( key ); - ldbm_datum_init( data ); -#endif Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %lu, %lu )\n", p ? p->e_id : 0, e->e_id, 0 ); diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index ee5e316071..7a4f7d075e 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -56,12 +56,7 @@ idl_fetch_one( Datum data; IDList *idl; -#ifdef HAVE_BERKELEY_DB2 - Datum k2; - ldbm_datum_init( data ); - ldbm_datum_init( k2 ); -#endif /* Debug( LDAP_DEBUG_TRACE, "=> idl_fetch_one\n", 0, 0, 0 ); */ diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index b3a620624e..d9e1061762 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -19,7 +19,9 @@ ldbm_back_init( char *argv[ 4 ]; int i; +#ifdef HAVE_BERKELEY_DB2 extern pthread_mutex_t dbEnvInit_mutex; +#endif /* allocate backend-specific stuff */ li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) ); @@ -77,7 +79,9 @@ ldbm_back_init( pthread_cond_init( &li->li_dbcache[i].dbc_cv, pthread_condattr_default ); } +#ifdef HAVE_BERKELEY_DB2 pthread_mutex_init( &dbEnvInit_mutex, pthread_mutexattr_default ); +#endif be->be_private = li; } diff --git a/servers/slapd/tools/ldbmcat.c b/servers/slapd/tools/ldbmcat.c index 6f2ea10340..f7e62c7d31 100644 --- a/servers/slapd/tools/ldbmcat.c +++ b/servers/slapd/tools/ldbmcat.c @@ -28,11 +28,11 @@ main( int argc, char **argv ) #ifdef HAVE_BERKELEY_DB2 DBC *cursorp; +#endif ldbm_datum_init( key ); ldbm_datum_init( last ); ldbm_datum_init( data ); -#endif if ( argc < 2 || argc > 3 || ( argc == 3 && strcmp( argv[1], "-n" ) != 0 )) { diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 70989a013a..4811584cc0 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -70,12 +70,12 @@ main( int argc, char **argv ) #ifdef HAVE_BERKELEY_DB2 DBC *cursorp; +#endif ldbm_datum_init( savekey ); ldbm_datum_init( key ); ldbm_datum_init( data ); ldbm_datum_init( last ); -#endif tailorfile = SLAPD_DEFAULT_CONFIGFILE; while ( (i = getopt( argc, argv, "d:f:" )) != EOF ) {