From 7bec52fe18467dac9be2d1d089f3f7e8cf002897 Mon Sep 17 00:00:00 2001 From: dimitr Date: Mon, 9 Feb 2009 10:14:16 +0000 Subject: [PATCH] Backported CORE-1923: "instsvc remove" returns 1 when succefully executed. --- src/utilities/install/install_svc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utilities/install/install_svc.cpp b/src/utilities/install/install_svc.cpp index c725101742..24d013ae81 100644 --- a/src/utilities/install/install_svc.cpp +++ b/src/utilities/install/install_svc.cpp @@ -359,7 +359,9 @@ int CLIB_ROUTINE main( int argc, char **argv) } } else - status = FB_FAILURE; + { + status = (GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST) ? FB_SUCCESS : FB_FAILURE; + } service = OpenService(manager, remote_service_name.c_str(), SERVICE_ALL_ACCESS); @@ -384,7 +386,9 @@ int CLIB_ROUTINE main( int argc, char **argv) } } else - status2 = FB_FAILURE; + { + status2 = (GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST) ? FB_SUCCESS : FB_FAILURE; + } if (status != FB_SUCCESS && status2 != FB_SUCCESS) status = FB_FAILURE;