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

View File

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