summaryrefslogtreecommitdiff
path: root/bin/bbackupd/Win32BackupService.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-10-17 12:53:29 +0000
committerChris Wilson <chris+github@qwirx.com>2007-10-17 12:53:29 +0000
commit213ee3a965d0b0dcba7207917ad7654d31d01edf (patch)
treeb264ad9df54b1d0e5d188baea1fdce2179d4e574 /bin/bbackupd/Win32BackupService.cpp
parent10d5c119ea513a17ad9fad2c65942d482aa317dd (diff)
Record the exit status of the daemon when running as a service, and
return it to Windows so that Windows doesn't tell the admin that "the service did not report an error" when it stopped unexpectedly. When failing to contact the SCM, report a textual error message as well as the error code. Make OurService() take a const char * instead of char *, so that we can pass it a std::string.c_str(). InstallService creates service using "-s" option instead of "--service", which no longer works once we use getopt() for option processing (to follow). (merges [1853])
Diffstat (limited to 'bin/bbackupd/Win32BackupService.cpp')
-rw-r--r--bin/bbackupd/Win32BackupService.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/bbackupd/Win32BackupService.cpp b/bin/bbackupd/Win32BackupService.cpp
index 9f0ac867..6d027abf 100644
--- a/bin/bbackupd/Win32BackupService.cpp
+++ b/bin/bbackupd/Win32BackupService.cpp
@@ -14,10 +14,12 @@
Win32BackupService* gpDaemonService = NULL;
extern HANDLE gStopServiceEvent;
+extern DWORD gServiceReturnCode;
unsigned int WINAPI RunService(LPVOID lpParameter)
{
DWORD retVal = gpDaemonService->WinService((const char*) lpParameter);
+ gServiceReturnCode = retVal;
SetEvent(gStopServiceEvent);
return retVal;
}