]> git.sur5r.net Git - openldap/commitdiff
ITS#4259 don't try to alock_close if we never opened...
authorHoward Chu <hyc@openldap.org>
Tue, 20 Dec 2005 00:44:05 +0000 (00:44 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 20 Dec 2005 00:44:05 +0000 (00:44 +0000)
servers/slapd/back-bdb/init.c

index 989b467e375ee259091fcf2c2824eebc6193b08c..c1a0bfcc624b27ade64b40ed96a81f127a9cb45d 100644 (file)
@@ -594,11 +594,13 @@ bdb_db_close( BackendDB *be )
                }
        }
 
-       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;
+       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;
+               }
        }
 
        return 0;