From 8c30ed7a5926adf54f833808ceb2572b63378393 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 3 Mar 2025 11:15:08 +0000 Subject: [PATCH] chore: Remove unused `m_autoDetectCommand` and ctor arg from Windows watchdog --- src/lib/deskflow/DaemonApp.cpp | 2 +- src/lib/platform/MSWindowsWatchdog.cpp | 7 +------ src/lib/platform/MSWindowsWatchdog.h | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib/deskflow/DaemonApp.cpp b/src/lib/deskflow/DaemonApp.cpp index 3a05f33f4..c6ae02a6e 100644 --- a/src/lib/deskflow/DaemonApp.cpp +++ b/src/lib/deskflow/DaemonApp.cpp @@ -212,7 +212,7 @@ void DaemonApp::mainLoop() DAEMON_RUNNING(true); #if SYSAPI_WIN32 - m_watchdog = std::make_unique(false, m_foreground); + m_watchdog = std::make_unique(m_foreground); m_watchdog->setFileLogOutputter(m_fileLogOutputter); // install the platform event queue to handle service stop events. diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index ecc476cee..54d9d737b 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -54,9 +54,8 @@ typedef VOID(WINAPI *SendSas)(BOOL asUser); const char g_activeDesktop[] = {"activeDesktop:"}; -MSWindowsWatchdog::MSWindowsWatchdog(bool autoDetectCommand, bool foreground) +MSWindowsWatchdog::MSWindowsWatchdog(bool foreground) : m_thread(NULL), - m_autoDetectCommand(autoDetectCommand), m_outputWritePipe(nullptr), m_outputReadPipe(nullptr), m_elevateProcess(false), @@ -372,10 +371,6 @@ void MSWindowsWatchdog::setProcessConfig(const std::string &command, bool elevat std::string MSWindowsWatchdog::getCommand() const { - if (!m_autoDetectCommand) { - return m_command; - } - // seems like a fairly convoluted way to get the process name const char *launchName = App::instance().argsBase().m_pname; std::string args = ARCH->commandLine(); diff --git a/src/lib/platform/MSWindowsWatchdog.h b/src/lib/platform/MSWindowsWatchdog.h index 085f53f6e..453d0770c 100644 --- a/src/lib/platform/MSWindowsWatchdog.h +++ b/src/lib/platform/MSWindowsWatchdog.h @@ -31,7 +31,7 @@ class MSWindowsWatchdog }; public: - MSWindowsWatchdog(bool autoDetectCommand, bool foreground); + MSWindowsWatchdog(bool foreground); ~MSWindowsWatchdog() = default; void startAsync(); @@ -64,7 +64,6 @@ private: private: Thread *m_thread; - bool m_autoDetectCommand; bool m_running; HANDLE m_outputWritePipe; HANDLE m_outputReadPipe;