]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/init.c
use slab memory for proxyauthz
[openldap] / servers / slapd / back-bdb / init.c
index c1a0bfcc624b27ade64b40ed96a81f127a9cb45d..eff1b5db620375bf5c7791fa3c0187ca1d9fc391 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -565,13 +565,14 @@ bdb_db_close( BackendDB *be )
                bdb->bi_idl_lru_head = bdb->bi_idl_lru_tail = NULL;
        }
 
-       if ( !( slapMode & SLAP_TOOL_QUICK ) && bdb->bi_dbenv ) {
-               XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
-               bdb->bi_cache.c_locker = 0;
-       }
-
        /* close db environment */
        if( bdb->bi_dbenv ) {
+               /* Free cache locker if we enabled locking */
+               if ( !( slapMode & SLAP_TOOL_QUICK )) {
+                       XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
+                       bdb->bi_cache.c_locker = 0;
+               }
+
                /* force a checkpoint, but not if we were ReadOnly,
                 * and not in Quick mode since there are no transactions there.
                 */
@@ -594,13 +595,11 @@ bdb_db_close( BackendDB *be )
                }
        }
 
-       if ( bdb->bi_alock_info.al_slot > 0 ) {
-               rc = alock_close( &bdb->bi_alock_info );
-               if( rc != 0 ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "bdb_db_close: alock_close failed\n", 0, 0, 0 );
-                       return -1;
-               }
+       rc = alock_close( &bdb->bi_alock_info );
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_close: alock_close failed\n", 0, 0, 0 );
+               return -1;
        }
 
        return 0;