diff options
-rw-r--r-- | util/ntservice.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/util/ntservice.cpp b/util/ntservice.cpp index 07dce206a02..251be926e25 100644 --- a/util/ntservice.cpp +++ b/util/ntservice.cpp @@ -111,11 +111,14 @@ namespace mongo { SERVICE_STATUS serviceStatus; - // stop service if running + // stop service if its running if ( ::ControlService( schService, SERVICE_CONTROL_STOP, &serviceStatus ) ) { while ( ::QueryServiceStatus( schService, &serviceStatus ) ) { if ( serviceStatus.dwCurrentState == SERVICE_STOP_PENDING ) - Sleep( 1000 ); + { + Sleep( 1000 ); + } + else { break; } } } |