diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-11-18 14:06:34 -0500 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-11-18 14:18:45 -0500 |
commit | cf00df557a4ba4e313458838766c649edcba3258 (patch) | |
tree | ab319d8a42af9c5c255d86cd23979992b6aca310 /src/mongo/util/ntservice.cpp | |
parent | 5cd68e1a6846ebdd07e5a75753108baab2e4af11 (diff) | |
download | mongo-cf00df557a4ba4e313458838766c649edcba3258.tar.gz |
SERVER-16085: Windows service: net stop MongoDB gives an error even after stopping the service
Diffstat (limited to 'src/mongo/util/ntservice.cpp')
-rw-r--r-- | src/mongo/util/ntservice.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/util/ntservice.cpp b/src/mongo/util/ntservice.cpp index 2c5dc8f66b7..8105ce63be6 100644 --- a/src/mongo/util/ntservice.cpp +++ b/src/mongo/util/ntservice.cpp @@ -496,8 +496,13 @@ namespace { ssStatus.dwServiceSpecificExitCode = exitCode; ssStatus.dwControlsAccepted = dwControlsAccepted; ssStatus.dwCurrentState = reportState; - ssStatus.dwWin32ExitCode = reportState == SERVICE_STOPPED - ? ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR; + + // Only report ERROR_SERVICE_SPECIFIC_ERROR when the exit is not clean + if (reportState == SERVICE_STOPPED && exitCode != EXIT_CLEAN) + ssStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; + else + ssStatus.dwWin32ExitCode = NO_ERROR; + ssStatus.dwWaitHint = waitHint; ssStatus.dwCheckPoint = ( reportState == SERVICE_RUNNING || reportState == SERVICE_STOPPED ) ? |