]> git.sur5r.net Git - openldap/commitdiff
Wrap db2 mutex with -DHAVE_BERKELEY_DB2 (should be hidden in -lldbm) ITS#35
authorKurt Zeilenga <kurt@openldap.org>
Thu, 7 Jan 1999 03:28:08 +0000 (03:28 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 7 Jan 1999 03:28:08 +0000 (03:28 +0000)
Unwrap ldbm_datum_init()

servers/slapd/back-ldbm/id2children.c
servers/slapd/back-ldbm/idl.c
servers/slapd/back-ldbm/init.c
servers/slapd/tools/ldbmcat.c
servers/slapd/tools/ldbmtest.c

index 171e6c2618dd27b13adb3117297994de3c0dcb13..aa8a79cecdec28aed1dd913ef2d2b3541a1d1f84 100644 (file)
@@ -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 );
index ee5e3160714f76975594e2b89624192ea65c7366..7a4f7d075e0c71dc90aa288e8f922660247b8a3a 100644 (file)
@@ -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 ); */
 
index b3a620624e460b32beed21e528ba8da22be46439..d9e10617624ee8cb99e7351da0cb9dc6f9be5fe6 100644 (file)
@@ -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;
 }
index 6f2ea10340408580698a40755fd9ce91aeee7ecc..f7e62c7d315b85000fad7a5f7ddf63fde67a1631 100644 (file)
@@ -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 )) {
index 70989a013a891389864bed0c6fb1484a994444e9..4811584cc0b52070772cda4e780f56ed6e165d5c 100644 (file)
@@ -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 ) {