]> git.sur5r.net Git - openldap/commitdiff
Add calls to module_init/module_kill to support dynamically loaded backends.
authorHoward Chu <hyc@openldap.org>
Wed, 18 Sep 2002 11:58:19 +0000 (11:58 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Sep 2002 11:58:19 +0000 (11:58 +0000)
servers/slapd/tools/slapcommon.c

index bf3b50383d69ab706a2a6cd762e43bc97447d87c..91f971106de7564da8ad0a5eeac0e94399ab1345 100644 (file)
@@ -181,6 +181,13 @@ slap_tool_init(
         * initialize stuff and figure out which backend we're dealing with
         */
 
+#ifdef SLAPD_MODULES
+       if ( module_init() != 0 ) {
+               fprintf( stderr, "%s: module_init failed!\n", progname );
+               exit( EXIT_FAILURE );
+       }
+#endif
+               
        rc = slap_init( mode, progname );
 
        if (rc != 0 ) {
@@ -278,6 +285,9 @@ void slap_tool_destroy( void )
 {
        slap_shutdown( be );
        slap_destroy();
+#ifdef SLAPD_MODULES
+       module_kill();
+#endif
        schema_destroy();
 #ifdef HAVE_TLS
        ldap_pvt_tls_destroy();