X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.cpp;h=9cdf9dedd301246632b5a32252e5d44b33be1d06;hb=0f9817471a5b65eeedf1b4a892e86fb486a55807;hp=53ee349a3fe3c02dcb62f7b7e08d8e62252e22b5;hpb=5ba652d97bd85a8ea84560e39fbffee5155825c1;p=nssm.git diff --git a/service.cpp b/service.cpp index 53ee349..9cdf9de 100644 --- a/service.cpp +++ b/service.cpp @@ -1214,6 +1214,9 @@ int control_service(unsigned long control, int argc, TCHAR **argv) { else { CloseHandle(service_handle); _ftprintf(stderr, _T("%s: %s: %s"), canonical_name, service_control_text(control), error_string(error)); + if (error == ERROR_SERVICE_NOT_ACTIVE) { + if (control == SERVICE_CONTROL_SHUTDOWN || control == SERVICE_CONTROL_STOP) return 0; + } return 1; } }