]> git.sur5r.net Git - openldap/commitdiff
slapdn calls shutdown without startup
authorPierangelo Masarati <ando@openldap.org>
Fri, 16 Dec 2005 22:24:53 +0000 (22:24 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 16 Dec 2005 22:24:53 +0000 (22:24 +0000)
servers/slapd/slapcommon.c

index 8d0e032f6d0725784a013edb4ec2aaee13bd0be4..6fc5afed39d6588a8f31b246ecd91a49e93fa2fe 100644 (file)
@@ -174,6 +174,8 @@ parse_slapacl( void )
  *     argc, argv      command line arguments
  */
 
+static int need_shutdown;
+
 void
 slap_tool_init(
        const char* progname,
@@ -663,6 +665,8 @@ startup:;
 
        /* slapdn doesn't specify a backend to startup */
        if ( !dryrun && tool != SLAPDN && slap_startup( be ) ) {
+               need_shutdown = 1;
+
                switch ( tool ) {
                case SLAPTEST:
                        fprintf( stderr, "slap_startup failed "
@@ -682,7 +686,9 @@ startup:;
 void slap_tool_destroy( void )
 {
        if ( !dryrun ) {
-               slap_shutdown( be );
+               if ( need_shutdown ) {
+                       slap_shutdown( be );
+               }
                slap_destroy();
        }
 #ifdef SLAPD_MODULES