diff options
author | Justin Dearing <zippy1981@gmail.com> | 2010-06-03 05:06:51 +0800 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-06-10 16:14:31 -0400 |
commit | 8cffdd6ed0e8e1c37b565e86b371c52e0190c706 (patch) | |
tree | 43bac6a83514f047593217af06182b7e78b19747 | |
parent | be489c67050c196dbfbd1136457d3cb6311035f0 (diff) | |
download | mongo-8cffdd6ed0e8e1c37b565e86b371c52e0190c706.tar.gz |
Fixed mongod hanging when issuing a "mongod --remove" with the service running.
If you attempted to remove the service while it was running, it would stop the service and hang in a while loop because a break statement was missing.
Conflicts:
util/ntservice.cpp
-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; } } } |