From cd5ba1382debb290e5f628fe4d5675260bcbd590 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 3 Mar 2025 11:38:54 +0000 Subject: [PATCH] chore: Clean up `shutdownExistingProcesses` (unused var and use if-init) in Windows watchdog --- src/lib/platform/MSWindowsWatchdog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index 77e75f7c1..fa0e437c8 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -394,11 +394,9 @@ void MSWindowsWatchdog::shutdownExistingProcesses() } // now just iterate until we can find winlogon.exe pid - DWORD pid = 0; while (gotEntry) { - HANDLE handle = openProcessForKill(entry); - if (handle) { + if (HANDLE handle = openProcessForKill(entry); handle != nullptr) { LOG((CLOG_INFO "shutting down process, name=%s, pid=%d", entry.szExeFile, entry.th32ProcessID)); deskflow::platform::MSWindowsProcess::shutdown(handle, entry.th32ProcessID); CloseHandle(handle);