From 84ccfb340a540a8981b849a5224fae3593ff6d43 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 10 Sep 2023 15:03:32 +0200 Subject: [PATCH] Fix compile errors. --- platform/windows/sub_process_windows.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/windows/sub_process_windows.cpp b/platform/windows/sub_process_windows.cpp index 0a6528795..27f112ab6 100644 --- a/platform/windows/sub_process_windows.cpp +++ b/platform/windows/sub_process_windows.cpp @@ -33,13 +33,13 @@ #include "core/containers/local_vector.h" // TODO clean these up -#include #include #include #include #include #include #include +#include Error SubProcessWindows::start() { if (_executable_path.empty()) { @@ -50,10 +50,10 @@ Error SubProcessWindows::start() { return ERR_BUSY; } - String path = p_path.replace("/", "\\"); + String path = _executable_path.replace("/", "\\"); String cmdline = _quote_command_line_argument(path); - const List::Element *I = p_arguments.front(); + const List::Element *I = _arguments.front(); while (I) { cmdline += " " + _quote_command_line_argument(I->get()); I = I->next(); @@ -149,11 +149,9 @@ Error SubProcessWindows::start() { WaitForSingleObject(_process_info.pi.hProcess, INFINITE); - if (r_exitcode) { - DWORD ret2; - GetExitCodeProcess(_process_info.pi.hProcess, &ret2); - _exitcode = ret2; - } + DWORD ret2; + GetExitCodeProcess(_process_info.pi.hProcess, &ret2); + _exitcode = ret2; CloseHandle(_process_info.pi.hProcess); CloseHandle(_process_info.pi.hThread); @@ -326,7 +324,9 @@ void SubProcessWindows::_append_to_pipe(char *p_bytes, int p_size) { SubProcessWindows::SubProcessWindows() : SubProcess() { - _pipe_handles = { NULL, NULL }; + + _pipe_handles[0] = NULL; + _pipe_handles[1] = NULL; _process_started = false;