]> git.sur5r.net Git - openldap/commitdiff
ITS#4319 fix check for need_shutdown/slap_shutdown()
authorHoward Chu <hyc@openldap.org>
Tue, 10 Jan 2006 18:32:09 +0000 (18:32 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 10 Jan 2006 18:32:09 +0000 (18:32 +0000)
servers/slapd/slapcommon.c

index a1d8c0d9d819d92a9324a15dd299b9a0287eabc6..9f99363dc8aa0d39a4f98717d1a1ea83504106dd 100644 (file)
@@ -627,22 +627,24 @@ startup:;
        }
 
        /* slapdn doesn't specify a backend to startup */
-       if ( !dryrun && tool != SLAPDN && slap_startup( be ) ) {
+       if ( !dryrun && tool != SLAPDN ) {
                need_shutdown = 1;
 
-               switch ( tool ) {
-               case SLAPTEST:
-                       fprintf( stderr, "slap_startup failed "
-                                       "(test would succeed using "
-                                       "the -u switch)\n" );
-                       break;
+               if ( slap_startup( be ) ) {
+                       switch ( tool ) {
+                       case SLAPTEST:
+                               fprintf( stderr, "slap_startup failed "
+                                               "(test would succeed using "
+                                               "the -u switch)\n" );
+                               break;
+
+                       default:
+                               fprintf( stderr, "slap_startup failed\n" );
+                               break;
+                       }
 
-               default:
-                       fprintf( stderr, "slap_startup failed\n" );
-                       break;
+                       exit( EXIT_FAILURE );
                }
-               
-               exit( EXIT_FAILURE );
        }
 }