changed m_relauncher to m_watchdog

This commit is contained in:
Nick Bolton 2013-10-15 10:04:27 +00:00
parent d09ee887d8
commit 8040f1c5a3
2 changed files with 13 additions and 12 deletions

View File

@ -44,6 +44,7 @@
#include "CScreen.h" #include "CScreen.h"
#include "CMSWindowsScreen.h" #include "CMSWindowsScreen.h"
#include "CMSWindowsDebugOutputter.h" #include "CMSWindowsDebugOutputter.h"
#include "CMSWindowsWatchdog.h"
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <Windows.h> #include <Windows.h>
@ -80,7 +81,7 @@ CDaemonApp::CDaemonApp() :
m_ipcServer(nullptr), m_ipcServer(nullptr),
m_ipcLogOutputter(nullptr) m_ipcLogOutputter(nullptr)
#if SYSAPI_WIN32 #if SYSAPI_WIN32
,m_relauncher(nullptr) ,m_watchdog(nullptr)
#endif #endif
{ {
s_instance = this; s_instance = this;
@ -209,7 +210,7 @@ CDaemonApp::mainLoop(bool logToFile)
CLOG->insert(m_ipcLogOutputter); CLOG->insert(m_ipcLogOutputter);
#if SYSAPI_WIN32 #if SYSAPI_WIN32
m_relauncher = new CMSWindowsWatchdog(false, *m_ipcServer, *m_ipcLogOutputter); m_watchdog = new CMSWindowsWatchdog(false, *m_ipcServer, *m_ipcLogOutputter);
#endif #endif
m_events->adoptHandler( m_events->adoptHandler(
@ -228,17 +229,17 @@ CDaemonApp::mainLoop(bool logToFile)
bool elevate = ARCH->setting("Elevate") == "1"; bool elevate = ARCH->setting("Elevate") == "1";
if (command != "") { if (command != "") {
LOG((CLOG_INFO "using last known command: %s", command.c_str())); LOG((CLOG_INFO "using last known command: %s", command.c_str()));
m_relauncher->setCommand(command, elevate); m_watchdog->setCommand(command, elevate);
} }
m_relauncher->startAsync(); m_watchdog->startAsync();
#endif #endif
m_events->loop(); m_events->loop();
#if SYSAPI_WIN32 #if SYSAPI_WIN32
m_relauncher->stop(); m_watchdog->stop();
delete m_relauncher; delete m_watchdog;
#endif #endif
m_events->removeHandler( m_events->removeHandler(
@ -344,7 +345,7 @@ CDaemonApp::handleIpcMessage(const CEvent& e, void*)
// tell the relauncher about the new command. this causes the // tell the relauncher about the new command. this causes the
// relauncher to stop the existing command and start the new // relauncher to stop the existing command and start the new
// command. // command.
m_relauncher->setCommand(command, cm->elevate()); m_watchdog->setCommand(command, cm->elevate());
#endif #endif
break; break;
} }

View File

@ -21,15 +21,15 @@
#include "CArch.h" #include "CArch.h"
#include "CIpcServer.h" #include "CIpcServer.h"
#if SYSAPI_WIN32
#include "CMSWindowsWatchdog.h"
#endif
#include <string> #include <string>
class CEvent; class CEvent;
class CIpcLogOutputter; class CIpcLogOutputter;
#if SYSAPI_WIN32
class CMSWindowsWatchdog;
#endif
class CDaemonApp { class CDaemonApp {
public: public:
@ -48,7 +48,7 @@ public:
static CDaemonApp* s_instance; static CDaemonApp* s_instance;
#if SYSAPI_WIN32 #if SYSAPI_WIN32
CMSWindowsWatchdog* m_relauncher; CMSWindowsWatchdog* m_watchdog;
#endif #endif
private: private: