fix(daemon): Only log XArchEvalWindows result when GetExitCodeProcess fails

This commit is contained in:
Nick Bolton
2025-04-15 23:13:52 +01:00
committed by Chris Rizzitello
parent 4988196c47
commit abc963f886

View File

@ -312,9 +312,12 @@ void MSWindowsWatchdog::startProcess()
if (!createRet) {
DWORD exitCode = 0;
GetExitCodeProcess(m_process->info().hProcess, &exitCode);
if (GetExitCodeProcess(m_process->info().hProcess, &exitCode)) {
LOG_ERR("daemon failed to run command, exit code: %d", exitCode);
} else {
LOG_ERR("daemon failed to run command, unknown exit code");
throw XArch(new XArchEvalWindows);
}
} else {
// Wait for program to fail. This needs to be 1 second, as the process may take some time to fail.
LOG_DEBUG("watchdog waiting for process start result");