mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
runnerw: use GetLastError as exit code if CreateProcessW fails (IDEA-CR-25052)
GetLastError returns error=2 if child process executable file not found (ERROR_FILE_NOT_FOUND from https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382)
This commit is contained in:
Binary file not shown.
@@ -294,10 +294,12 @@ int main(int argc, char * argv[]) {
|
||||
NULL,
|
||||
&si,
|
||||
&pi)) {
|
||||
DWORD exitCode = GetLastError();
|
||||
if (exitCode == 0) exitCode = 1;
|
||||
ErrorMessage("CreateProcess");
|
||||
CloseHandle(newstdin);
|
||||
CloseHandle(write_stdin);
|
||||
exit(2);
|
||||
exit(exitCode);
|
||||
}
|
||||
if (hasConsoleWindow || childParams.createNewConsole) {
|
||||
attachChildConsole(pi);
|
||||
@@ -308,7 +310,7 @@ int main(int argc, char * argv[]) {
|
||||
|
||||
CreateThread(NULL, 0, &scanStdinThread, &write_stdin, 0, NULL);
|
||||
|
||||
unsigned long exitCode = 0;
|
||||
DWORD exitCode = 0;
|
||||
|
||||
while (true) {
|
||||
int rc = WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
Reference in New Issue
Block a user