Ignore:
Timestamp:
22/09/2007 00:03:10 (5 years ago)
Author:
chris
Message:

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/chris/general/bin/bbackupd/Win32BackupService.cpp

    r1813 r1853  
    1515Win32BackupService* gpDaemonService = NULL; 
    1616extern HANDLE gStopServiceEvent; 
     17extern DWORD gServiceReturnCode; 
    1718 
    1819unsigned int WINAPI RunService(LPVOID lpParameter) 
    1920{ 
    2021        DWORD retVal = gpDaemonService->WinService((const char*) lpParameter); 
     22        gServiceReturnCode = retVal; 
    2123        SetEvent(gStopServiceEvent); 
    2224        return retVal; 
Note: See TracChangeset for help on using the changeset viewer.