8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Fix non initialized variables

This commit is contained in:
brodsom 2004-08-26 18:49:49 +00:00
parent 9c04d32118
commit 7593638007
2 changed files with 18 additions and 4 deletions

View File

@ -136,12 +136,15 @@ int CLIB_ROUTINE main( int argc, char** argv)
break; break;
case COMMAND_REMOVE: case COMMAND_REMOVE:
ret = REGISTRY_remove(hkey_node, false, reg_error); ret = REGISTRY_remove(hkey_node, false, reg_error);
if (ret != FB_SUCCESS) if (ret != FB_SUCCESS)
printf("Firebird has not been deleted from the registry.\n"); printf("Firebird has not been deleted from the registry.\n");
else else
printf("Firebird has been successfully deleted from the registry.\n"); printf("Firebird has been successfully deleted from the registry.\n");
break; break;
default:
ret = FB_SUCCESS;
} }
if (hkey_node != HKEY_LOCAL_MACHINE) if (hkey_node != HKEY_LOCAL_MACHINE)

View File

@ -298,23 +298,30 @@ int CLIB_ROUTINE main( int argc, char **argv)
printf("You must stop it before attempting to delete it.\n\n"); printf("You must stop it before attempting to delete it.\n\n");
} }
} }
else
status = FB_FAILURE;
service = OpenService(manager, REMOTE_SERVICE, SERVICE_ALL_ACCESS); service = OpenService(manager, REMOTE_SERVICE, SERVICE_ALL_ACCESS);
if (service) if (service)
{ {
CloseServiceHandle(service); CloseServiceHandle(service);
status = SERVICES_remove(manager, REMOTE_SERVICE, REMOTE_DISPLAY_NAME, status2 = SERVICES_remove(manager, REMOTE_SERVICE, REMOTE_DISPLAY_NAME,
svc_error); svc_error);
if (status == FB_SUCCESS) if (status2 == FB_SUCCESS)
{ {
printf("Service \"%s\" successfully deleted.\n", REMOTE_DISPLAY_NAME); 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("Service \"%s\" not deleted.\n", REMOTE_DISPLAY_NAME);
printf("You must stop it before attempting to delete it.\n\n"); 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; break;
case COMMAND_START: case COMMAND_START:
@ -362,7 +369,11 @@ int CLIB_ROUTINE main( int argc, char **argv)
case COMMAND_QUERY: case COMMAND_QUERY:
svc_query(ISCGUARD_SERVICE, ISCGUARD_DISPLAY_NAME, manager); svc_query(ISCGUARD_SERVICE, ISCGUARD_DISPLAY_NAME, manager);
svc_query(REMOTE_SERVICE, REMOTE_DISPLAY_NAME, manager); svc_query(REMOTE_SERVICE, REMOTE_DISPLAY_NAME, manager);
status = FB_SUCCESS;
break; break;
default:
status = FB_SUCCESS;
} }
CloseServiceHandle(manager); CloseServiceHandle(manager);