From 7be5837dc097bdea76403b70d0a4a61da27a3764 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 18 Nov 2011 01:22:52 -0800 Subject: [PATCH] Cleanup syncprov_db_close/CONFIG_DELETE code No mutex needed since config ops are single-threaded. Don't send Unavailable message if we're shutting down. --- servers/slapd/overlays/syncprov.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 2104c49476..8a2e87f386 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -3168,16 +3168,16 @@ syncprov_db_close( } #ifdef SLAP_CONFIG_DELETE - ldap_pvt_thread_mutex_lock( &si->si_ops_mutex ); - for ( so=si->si_ops, sonext=so; so; so=sonext ) { - SlapReply rs = {REP_RESULT}; - rs.sr_err = LDAP_UNAVAILABLE; - send_ldap_result( so->s_op, &rs ); - sonext=so->s_next; - syncprov_drop_psearch( so, 0); - } - si->si_ops=NULL; - ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); + if ( !slapd_shutdown ) { + for ( so=si->si_ops, sonext=so; so; so=sonext ) { + SlapReply rs = {REP_RESULT}; + rs.sr_err = LDAP_UNAVAILABLE; + send_ldap_result( so->s_op, &rs ); + sonext=so->s_next; + syncprov_drop_psearch( so, 0); + } + si->si_ops=NULL; + } overlay_unregister_control( be, LDAP_CONTROL_SYNC ); #endif /* SLAP_CONFIG_DELETE */ -- 2.39.5