mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
Better error message if CreateService() fails.
This commit is contained in:
parent
94053aebc8
commit
e486468edc
@ -88,11 +88,12 @@ namespace mongo {
|
||||
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
|
||||
commandLineWide.str().c_str(), NULL, NULL, L"\0\0", NULL, NULL );
|
||||
if ( schService == NULL ) {
|
||||
log() << "Error creating service." << endl;
|
||||
::CloseServiceHandle( schSCManager );
|
||||
return false;
|
||||
}
|
||||
if ( schService == NULL ) {
|
||||
DWORD err = ::GetLastError();
|
||||
log() << "Error creating service: " << GetWinErrMsg(err) << endl;
|
||||
::CloseServiceHandle( schSCManager );
|
||||
return false;
|
||||
}
|
||||
|
||||
log() << "Service creation successful." << endl;
|
||||
log() << "Service can be started from the command line via 'net start \"" << toUtf8String(serviceName) << "\"'." << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user