diff options
| author | 2021-11-10 00:54:35 -0500 | |
|---|---|---|
| committer | 2021-11-10 00:54:35 -0500 | |
| commit | 58fb7a0cee13d84170aac52f3f89d91888e1afe3 (patch) | |
| tree | 1d6312ba15f9ece5a8031e5280dfb8b38be8dfa3 /src/lib/barrier/win32/DaemonApp.cpp | |
| parent | 28db84b46139c9bb2bbcac8c6cc56e71d1e35629 (diff) | |
| parent | beb08eb751fa8e1f72042f263316ab5e5ddb596d (diff) | |
Update upstream source from tag 'upstream/2.4.0+dfsg'
Update to upstream version '2.4.0+dfsg'
with Debian dir 4b6668cc08c7b0e56b1e1f7b4e89ecdb316182a0
Diffstat (limited to 'src/lib/barrier/win32/DaemonApp.cpp')
| -rw-r--r-- | src/lib/barrier/win32/DaemonApp.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/barrier/win32/DaemonApp.cpp b/src/lib/barrier/win32/DaemonApp.cpp index 482c465..81ec5ff 100644 --- a/src/lib/barrier/win32/DaemonApp.cpp +++ b/src/lib/barrier/win32/DaemonApp.cpp @@ -2,11 +2,11 @@ * barrier -- mouse and keyboard sharing utility * Copyright (C) 2012-2016 Symless Ltd. * Copyright (C) 2012 Nick Bolton - * + * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file LICENSE that should have accompanied this file. - * + * * This package is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -28,7 +28,6 @@ #include "net/SocketMultiplexer.h" #include "arch/XArch.h" #include "base/Log.h" -#include "base/TMethodJob.h" #include "base/TMethodEventJob.h" #include "base/EventQueue.h" #include "base/log_outputters.h" @@ -87,7 +86,7 @@ DaemonApp::run(int argc, char** argv) { // win32 instance needed for threading, etc. ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL)); - + Arch arch; arch.init(); @@ -174,7 +173,7 @@ DaemonApp::mainLoop(bool daemonized) try { DAEMON_RUNNING(true); - + if (daemonized) { m_fileLogOutputter = new FileLogOutputter(logFilename().c_str()); CLOG->insert(m_fileLogOutputter); @@ -190,19 +189,19 @@ DaemonApp::mainLoop(bool daemonized) // send logging to gui via ipc, log system adopts outputter. m_ipcLogOutputter = new IpcLogOutputter(*m_ipcServer, kIpcClientGui, true); CLOG->insert(m_ipcLogOutputter); - + m_watchdog = new MSWindowsWatchdog(daemonized, false, *m_ipcServer, *m_ipcLogOutputter); m_watchdog->setFileLogOutputter(m_fileLogOutputter); - + m_events->adoptHandler( m_events->forIpcServer().messageReceived(), m_ipcServer, new TMethodEventJob<DaemonApp>(this, &DaemonApp::handleIpcMessage)); m_ipcServer->listen(); - + // install the platform event queue to handle service stop events. m_events->adoptBuffer(new MSWindowsEventQueueBuffer(m_events)); - + String command = ARCH->setting("Command"); bool elevate = ARCH->setting("Elevate") == "1"; if (command != "") { @@ -219,11 +218,11 @@ DaemonApp::mainLoop(bool daemonized) m_events->removeHandler( m_events->forIpcServer().messageReceived(), m_ipcServer); - + CLOG->remove(m_ipcLogOutputter); delete m_ipcLogOutputter; delete m_ipcServer; - + DAEMON_RUNNING(false); } catch (std::exception& e) { @@ -245,7 +244,7 @@ DaemonApp::logFilename() { string logFilename = ARCH->setting("LogFilename"); if (logFilename.empty()) - logFilename = DataDirectories::global() + "\\" + LOG_FILENAME; + logFilename = (barrier::DataDirectories::global() / LOG_FILENAME).u8string(); MSWindowsUtil::createDirectory(logFilename, true); return logFilename; } @@ -287,7 +286,7 @@ DaemonApp::handleIpcMessage(const Event& e, void*) } delete[] argv; - + String logLevel(argBase->m_logFilter); if (!logLevel.empty()) { try { |
