From 7593638007dd65cd50a5d5f3d7a254c14c59179e Mon Sep 17 00:00:00 2001 From: brodsom Date: Thu, 26 Aug 2004 18:49:49 +0000 Subject: [PATCH] Fix non initialized variables --- src/utilities/install/install_reg.cpp | 5 ++++- src/utilities/install/install_svc.cpp | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/utilities/install/install_reg.cpp b/src/utilities/install/install_reg.cpp index 4ac236198f..5d360e75df 100644 --- a/src/utilities/install/install_reg.cpp +++ b/src/utilities/install/install_reg.cpp @@ -136,12 +136,15 @@ int CLIB_ROUTINE main( int argc, char** argv) break; case COMMAND_REMOVE: - ret = REGISTRY_remove(hkey_node, false, reg_error); + ret = REGISTRY_remove(hkey_node, false, reg_error); if (ret != FB_SUCCESS) printf("Firebird has not been deleted from the registry.\n"); else printf("Firebird has been successfully deleted from the registry.\n"); break; + + default: + ret = FB_SUCCESS; } if (hkey_node != HKEY_LOCAL_MACHINE) diff --git a/src/utilities/install/install_svc.cpp b/src/utilities/install/install_svc.cpp index a102e26fa0..c5b13f98d7 100644 --- a/src/utilities/install/install_svc.cpp +++ b/src/utilities/install/install_svc.cpp @@ -298,23 +298,30 @@ int CLIB_ROUTINE main( int argc, char **argv) printf("You must stop it before attempting to delete it.\n\n"); } } + else + status = FB_FAILURE; service = OpenService(manager, REMOTE_SERVICE, SERVICE_ALL_ACCESS); if (service) { CloseServiceHandle(service); - status = SERVICES_remove(manager, REMOTE_SERVICE, REMOTE_DISPLAY_NAME, + status2 = SERVICES_remove(manager, REMOTE_SERVICE, REMOTE_DISPLAY_NAME, svc_error); - if (status == FB_SUCCESS) + if (status2 == FB_SUCCESS) { printf("Service \"%s\" successfully deleted.\n", REMOTE_DISPLAY_NAME); } - else if (status == IB_SERVICE_RUNNING) + else if (status2 == IB_SERVICE_RUNNING) { printf("Service \"%s\" not deleted.\n", REMOTE_DISPLAY_NAME); printf("You must stop it before attempting to delete it.\n\n"); } } + else + status2 = FB_FAILURE; + + if (status != FB_SUCCESS && status2 != FB_SUCCESS) + status = FB_FAILURE; break; case COMMAND_START: @@ -362,7 +369,11 @@ int CLIB_ROUTINE main( int argc, char **argv) case COMMAND_QUERY: svc_query(ISCGUARD_SERVICE, ISCGUARD_DISPLAY_NAME, manager); svc_query(REMOTE_SERVICE, REMOTE_DISPLAY_NAME, manager); + status = FB_SUCCESS; break; + + default: + status = FB_SUCCESS; } CloseServiceHandle(manager);