]> git.sur5r.net Git - openldap/commitdiff
Cleanup syncprov_db_close/CONFIG_DELETE code
authorHoward Chu <hyc@openldap.org>
Fri, 18 Nov 2011 09:22:52 +0000 (01:22 -0800)
committerHoward Chu <hyc@openldap.org>
Fri, 18 Nov 2011 09:22:52 +0000 (01:22 -0800)
No mutex needed since config ops are single-threaded.
Don't send Unavailable message if we're shutting down.

servers/slapd/overlays/syncprov.c

index 2104c4947634a8bb30eb01b94e799b06cf3283c3..8a2e87f38668a8a619fe084aaa43320e03aac378 100644 (file)
@@ -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 */