]> git.sur5r.net Git - openldap/commitdiff
Use bi_db_{open,close} to run SLAPI start/close plugins
authorLuke Howard <lukeh@openldap.org>
Tue, 14 Feb 2006 09:20:50 +0000 (09:20 +0000)
committerLuke Howard <lukeh@openldap.org>
Tue, 14 Feb 2006 09:20:50 +0000 (09:20 +0000)
servers/slapd/init.c
servers/slapd/slapi/slapi_overlay.c

index 8cf3c7ae0e1fe3fc1874f783b5fe47cf1f68c278..226fda0945b18014f4b5c19a41c00597938fd9a2 100644 (file)
@@ -247,20 +247,7 @@ int slap_startup( Backend *be )
                slap_name, 0, 0 );
 
 
-       rc = backend_startup( be );
-
-#ifdef LDAP_SLAPI
-       if( rc == 0 ) {
-               Slapi_PBlock *pb = slapi_pblock_new();
-
-               if ( slapi_int_call_plugins( frontendDB, SLAPI_PLUGIN_START_FN, pb ) < 0 ) {
-                       rc = -1;
-               }
-               slapi_pblock_destroy( pb );
-       }
-#endif /* LDAP_SLAPI */
-
-       return rc;
+       return backend_startup( be );
 }
 
 int slap_shutdown( Backend *be )
@@ -275,15 +262,7 @@ int slap_shutdown( Backend *be )
                slap_name, 0, 0 );
 
        /* let backends do whatever cleanup they need to do */
-       rc = backend_shutdown( be ); 
-
-#ifdef LDAP_SLAPI
-       pb = slapi_pblock_new();
-       (void) slapi_int_call_plugins( frontendDB, SLAPI_PLUGIN_CLOSE_FN, pb );
-       slapi_pblock_destroy( pb );
-#endif /* LDAP_SLAPI */
-
-       return rc;
+       return backend_shutdown( be ); 
 }
 
 int slap_destroy(void)
index 1ffe35af6d74f2eb15c2bb9652000c5aa8156ed6..424a3d77989fb39e37b165a5abfb0c2c74b60320 100644 (file)
@@ -840,6 +840,36 @@ done:
        return rc;
 }
 
+static int
+slapi_over_db_open( BackendDB *be )
+{
+       Slapi_PBlock            *pb;
+       int                     rc;
+
+       pb = slapi_pblock_new();
+
+       rc = slapi_int_call_plugins( be, SLAPI_PLUGIN_START_FN, pb );
+
+       slapi_pblock_destroy( pb );
+
+       return rc;
+}
+
+static int
+slapi_over_db_close( BackendDB *be )
+{
+       Slapi_PBlock            *pb;
+       int                     rc;
+
+       pb = slapi_pblock_new();
+
+       rc = slapi_int_call_plugins( be, SLAPI_PLUGIN_CLOSE_FN, pb );
+
+       slapi_pblock_destroy( pb );
+
+       return rc;
+}
+
 static int
 slapi_over_init()
 {
@@ -858,6 +888,9 @@ slapi_over_init()
        slapi.on_bi.bi_op_abandon       = slapi_op_func;
        slapi.on_bi.bi_op_cancel        = slapi_op_func;
 
+       slapi.on_bi.bi_db_open          = slapi_over_db_open;
+       slapi.on_bi.bi_db_close         = slapi_over_db_close;
+
        slapi.on_bi.bi_extended         = slapi_over_extended;
        slapi.on_bi.bi_access_allowed   = slapi_over_access_allowed;
        slapi.on_bi.bi_operational      = slapi_over_aux_operational;