]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/translucent.c
ITS#4720 release csn mutex before checkpointing.
[openldap] / servers / slapd / overlays / translucent.c
index 5c8fd34788be08313346d29b44147781e75f6181..4b908c13672d1261692fa00ba8aa780b2f127768 100644 (file)
@@ -741,15 +741,17 @@ static int translucent_db_open(BackendDB *be) {
 **
 */
 
-static int translucent_db_close(BackendDB *be) {
+static int
+translucent_db_close( BackendDB *be )
+{
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov = on->on_bi.bi_private;
        int rc = 0;
 
        Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
 
-       if ( ov ) {
-               rc = (ov->db.bd_info && ov->db.bd_info->bi_db_close) ? ov->db.bd_info->bi_db_close(&ov->db) : 0;
+       if ( ov && ov->db.bd_info && ov->db.bd_info->bi_db_close ) {
+               rc = ov->db.bd_info->bi_db_close(&ov->db);
        }
 
        return(rc);
@@ -761,7 +763,9 @@ static int translucent_db_close(BackendDB *be) {
 **
 */
 
-static int translucent_db_destroy(BackendDB *be) {
+static int
+translucent_db_destroy( BackendDB *be )
+{
        slap_overinst *on = (slap_overinst *) be->bd_info;
        translucent_info *ov = on->on_bi.bi_private;
        int rc = 0;
@@ -769,7 +773,10 @@ static int translucent_db_destroy(BackendDB *be) {
        Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
 
        if ( ov ) {
-               rc = (ov->db.bd_info && ov->db.bd_info->bi_db_destroy) ? ov->db.bd_info->bi_db_destroy(&ov->db) : 0;
+               if ( ov->db.be_private != NULL ) {
+                       backend_stopdown_one( &ov->db );
+               }
+
                ch_free(ov);
                on->on_bi.bi_private = NULL;
        }