]> git.sur5r.net Git - openldap/commitdiff
ITS#5745 report errors in shutdown processing
authorHoward Chu <hyc@openldap.org>
Mon, 3 Nov 2008 13:23:05 +0000 (13:23 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 3 Nov 2008 13:23:05 +0000 (13:23 +0000)
servers/slapd/backend.c
servers/slapd/slapacl.c
servers/slapd/slapadd.c
servers/slapd/slapauth.c
servers/slapd/slapcat.c
servers/slapd/slapcommon.c
servers/slapd/slapcommon.h
servers/slapd/slapdn.c
servers/slapd/slapindex.c
servers/slapd/slaptest.c

index 459490b4ee8eea9be6561c47dde6b548d4d3629e..3754a258f20af6203dbce3bc5d295c85632fd207 100644 (file)
@@ -349,11 +349,13 @@ int backend_shutdown( Backend *be )
                }
 
                if ( be->bd_info->bi_db_close ) {
-                       be->bd_info->bi_db_close( be, NULL );
+                       rc = be->bd_info->bi_db_close( be, NULL );
+                       if ( rc ) return rc;
                }
 
                if( be->bd_info->bi_close ) {
-                       be->bd_info->bi_close( be->bd_info );
+                       rc = be->bd_info->bi_close( be->bd_info );
+                       if ( rc ) return rc;
                }
 
                return 0;
index 67cf7b3b56b62ee8e14659fd7f67c7e06a8ea9cb..a6a56c29cdbee52c657cb49513ec84f59c4171e0 100644 (file)
@@ -399,7 +399,8 @@ destroy:;
                }
        }
 
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
 
        return rc;
 }
index 468dcea6716c6f1d14b8660bc6c4e2cbebc88abf..442446c1d26ffa416d71a3f4b22e0467566b50b0 100644 (file)
@@ -447,7 +447,8 @@ slapadd( int argc, char **argv )
                }
        }
 
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
 
        return rc;
 }
index 8934df3b29faad7016f84f37db954fd4aec7bd8b..0482f9ff5dc9777dd59e4a83babcdec63fa41ab4 100644 (file)
@@ -166,7 +166,8 @@ destroy:;
        if ( !BER_BVISNULL( &authzID ) ) {
                op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
        }
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
 
        return rc;
 }
index 6ea1952006502541080756408981bf00ea2f8039..80586ef65111b75b0fc19e7ed306a9ef8a92e8bd 100644 (file)
@@ -134,6 +134,7 @@ slapcat( int argc, char **argv )
 
        be->be_entry_close( be );
 
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
        return rc;
 }
index 6050629cd3b25de64dfb5e36c3a4d9ba47bec27c..fad2bb9a960e7be359a1de93af9108e0c6e93bc5 100644 (file)
@@ -740,13 +740,16 @@ startup:;
        }
 }
 
-void slap_tool_destroy( void )
+int slap_tool_destroy( void )
 {
+       int rc = 0;
        if ( !dryrun ) {
                if ( need_shutdown ) {
-                       slap_shutdown( be );
+                       if ( slap_shutdown( be ))
+                               rc = EXIT_FAILURE;
                }
-               slap_destroy();
+               if ( slap_destroy())
+                       rc = EXIT_FAILURE;
        }
 #ifdef SLAPD_MODULES
        if ( slapMode == SLAP_SERVER_MODE ) {
@@ -772,4 +775,5 @@ void slap_tool_destroy( void )
        if ( ldiffp && ldiffp != &dummy ) {
                ldif_close( ldiffp );
        }
+       return rc;
 }
index 9cc22fed48d0f8867879e1b60b81cf7ab6ef8bbf..32138d1c22d474d1c4170b5eff4c1770e365cfb6 100644 (file)
@@ -101,6 +101,6 @@ void slap_tool_init LDAP_P((
        int tool,
        int argc, char **argv ));
 
-void slap_tool_destroy LDAP_P((void));
+int slap_tool_destroy LDAP_P((void));
 
 #endif /* SLAPCOMMON_H_ */
index 2aa12232b23e50ac1c4c57836ac3852ce6771415..ba32462dd49f64faf210768764b293542c0a93c5 100644 (file)
@@ -99,7 +99,8 @@ slapdn( int argc, char **argv )
                }
        }
        
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
 
        return rc;
 }
index 6b1f9bb92a879b8b31545ce4d11478717118a393..81ddf6ee93feaaac04e6c6bde7b8da03e4ade845 100644 (file)
@@ -99,6 +99,7 @@ slapindex( int argc, char **argv )
 
        (void) be->be_entry_close( be );
 
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
        return( rc );
 }
index c47abf85d78098755cd962b63162a42678fa6a04..e38bb0de695dd4d0c82297dedfd8f8bb0c9a3ba8 100644 (file)
@@ -108,7 +108,8 @@ slaptest( int argc, char **argv )
                fprintf( stderr, "config file testing succeeded\n");
        }
 
-       slap_tool_destroy();
+       if ( slap_tool_destroy())
+               rc = EXIT_FAILURE;
 
        return rc;
 }