From f392650be2434aadad71af95a0b81a33900e84ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 30 May 2018 12:18:01 +0200 Subject: Improve return value of OS.execute in blocking/non-blocking variants Initialized the PID to -2, which will be the value returns in blocking- mode where the PID is not available. (-1 was already taken to signify an execution failure). OS::execute will now properly return a non-OK error code when it fails to execute the target file. The documentation was rewritten to be very clear about the differences between blocking and non-blocking mode. Fixes #19056. --- platform/windows/os_windows.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'platform/windows') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index aef1b8a595..3e0c4a7c0c 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2209,10 +2209,6 @@ Error OS_Windows::execute(const String &p_path, const List &p_arguments, argss += String(" \"") + E->get() + "\""; } - //print_line("ARGS: "+argss); - //argss+"\""; - //argss+=" 2>nul"; - FILE *f = _wpopen(argss.c_str(), L"r"); ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); @@ -2239,15 +2235,12 @@ Error OS_Windows::execute(const String &p_path, const List &p_arguments, I = I->next(); }; - //cmdline+="\""; - ProcessInfo pi; ZeroMemory(&pi.si, sizeof(pi.si)); pi.si.cb = sizeof(pi.si); ZeroMemory(&pi.pi, sizeof(pi.pi)); LPSTARTUPINFOW si_w = (LPSTARTUPINFOW)&pi.si; - print_line("running cmdline: " + cmdline); Vector modstr; //windows wants to change this no idea why modstr.resize(cmdline.size()); for (int i = 0; i < cmdline.size(); i++) -- cgit v1.2.3