]> git.sur5r.net Git - openldap/commitdiff
BerkeleyDB's CDB support
authorKurt Zeilenga <kurt@openldap.org>
Sat, 2 Jun 2001 02:30:13 +0000 (02:30 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 2 Jun 2001 02:30:13 +0000 (02:30 +0000)
build/openldap.m4
build/top.mk

index eba963945b8bd38a8fa053af3eb1d74bddaa9f71..1ebdc19f18ac53d24e66607e60ddffb50a4cbd4b 100644 (file)
@@ -315,20 +315,41 @@ AC_DEFUN([OL_BERKELEY_DB_THREAD],
 main()
 {
        int rc;
-       u_int32_t flags = DB_CREATE | DB_THREAD;
+       u_int32_t flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL |
+#ifdef DB_PRIVATE
+               DB_PRIVATE |
+#endif
+#ifdef DB_MPOOL_PRIVATE
+               DB_MPOOL_PRIVATE |
+#endif
+               DB_THREAD;
 
 #if DB_VERSION_MAJOR > 2
        DB_ENV *env = NULL;
 
        rc = db_env_create( &env, 0 );
 
-       if( rc == 0 ) {
+       if( rc ) return rc;
+
+#ifdef DB_CDB_ALLDB
+       rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
+       if( rc ) goto done;
+#endif
+
 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
-               rc = env->open( env, NULL, flags, 0 );
+       rc = env->open( env, NULL, flags, 0 );
 #else
-               rc = env->open( env, NULL, NULL, flags, 0 );
+       rc = env->open( env, NULL, NULL, flags, 0 );
+#endif
+
+#ifdef DB_CDB_ALLDB
+done:
+#endif
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+       env->remove( env, NULL, DB_FORCE);
+#else
+       env->remove( env, NULL, NULL, DB_FORCE);
 #endif
-       }
 
 #else
        DB_ENV env;
@@ -339,13 +360,9 @@ 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
+
+       unlink("__db_mpool.share");
+       unlink("__db_lock.share");
 #endif
 
        return rc;
index 666e7ac0be2a3ad01fd0597da56cbab044e49322..461b039bf600d8d6a9ffcf84ec448accfb8116f9 100644 (file)
@@ -2,10 +2,11 @@
 ## Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
 ## All rights reserved.
 ##
-## Redistribution and use in source and binary forms are permitted only
-## as authorized by the OpenLDAP Public License.  A copy of this
-## license is available at http://www.OpenLDAP.org/license.html or
-## in file LICENSE in the top-level directory of the distribution.
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.  A copy of this license is available at
+## http://www.OpenLDAP.org/license.html or in file LICENSE in the
+## top-level directory of the distribution.
 ##
 PACKAGE= @PACKAGE@
 VERSION= @VERSION@