X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=79762e3acdca5b87c0c26f84b0da12bb90700d11;hb=7ee885a1f6776be85e5397eda04f75d98ff0b631;hp=54816a3de1c0737b4a8db3a6ae649f86436abe12;hpb=a3f04cf74463e783eeddd45e998c1d15db0f868a;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 54816a3d..79762e3a 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -722,19 +722,20 @@ static bool remove_service(void) { SC_HANDLE manager = NULL; SC_HANDLE service = NULL; SERVICE_STATUS status = {0}; + bool success = false; manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if(!manager) { fprintf(stderr, "Could not open service manager: %s\n", winerror(GetLastError())); - return false; + goto exit; } service = OpenService(manager, identname, SERVICE_ALL_ACCESS); if(!service) { fprintf(stderr, "Could not open %s service: %s\n", identname, winerror(GetLastError())); - return false; + goto exit; } if(!ControlService(service, SERVICE_CONTROL_STOP, &status)) { @@ -745,9 +746,13 @@ static bool remove_service(void) { if(!DeleteService(service)) { fprintf(stderr, "Could not remove %s service: %s\n", identname, winerror(GetLastError())); - return false; + goto exit; } + success = true; + +exit: + if(service) { CloseServiceHandle(service); } @@ -756,9 +761,11 @@ static bool remove_service(void) { CloseServiceHandle(manager); } - fprintf(stderr, "%s service removed\n", identname); + if(success) { + fprintf(stderr, "%s service removed\n", identname); + } - return true; + return success; } #endif @@ -1688,6 +1695,7 @@ const var_t variables[] = { {"Ed25519PrivateKeyFile", VAR_SERVER}, {"ExperimentalProtocol", VAR_SERVER}, {"Forwarding", VAR_SERVER}, + {"FWMark", VAR_SERVER}, {"GraphDumpFile", VAR_SERVER | VAR_OBSOLETE}, {"Hostnames", VAR_SERVER}, {"IffOneQueue", VAR_SERVER},