]> git.sur5r.net Git - openldap/commitdiff
Make sure db_close only gets called once
authorHoward Chu <hyc@openldap.org>
Sun, 5 Dec 2004 07:07:50 +0000 (07:07 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 5 Dec 2004 07:07:50 +0000 (07:07 +0000)
servers/slapd/overlays/glue.c

index a2fb18fe14010eef9539cba02c95ee37f639cfbb..c40c95109bb42b0de03324aa636ea3e31790eda4 100644 (file)
@@ -678,6 +678,21 @@ glue_db_open (
        return 0;
 }
 
+static int
+glue_db_close( 
+       BackendDB *be
+)
+{
+       slap_overinst   *on = (slap_overinst *)be->bd_info;
+       int rc = 0;
+
+       if ( on->on_info->oi_orig->bi_db_close ) {
+               rc = on->on_info->oi_orig->bi_db_close( be );
+               on->on_info->oi_orig->bi_db_close = NULL;
+       }
+       return rc;
+}
+
 static int
 glue_db_config(
        BackendDB       *be,
@@ -741,6 +756,7 @@ glue_init()
        glue.on_bi.bi_db_init = glue_db_init;
        glue.on_bi.bi_db_config = glue_db_config;
        glue.on_bi.bi_db_open = glue_db_open;
+       glue.on_bi.bi_db_close = glue_db_close;
        glue.on_bi.bi_db_destroy = glue_db_destroy;
 
        glue.on_bi.bi_op_search = glue_op_search;