From 5b7f102ad215f474d696f45e053318e26b4d1684 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 20 Dec 2005 00:44:05 +0000 Subject: [PATCH] ITS#4259 don't try to alock_close if we never opened... --- servers/slapd/back-bdb/init.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 989b467e37..c1a0bfcc62 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -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; -- 2.39.5