cmd: Even if FindExecutable fails wait for process to finish in non-interactive mode.
This commit is contained in:
parent
b0bf061235
commit
e727e44dfa
|
@ -1225,16 +1225,13 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||||
if (!status)
|
if (!status)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!assumeInternal && !console) errorlevel = 0;
|
/* Always wait when non-interactive (cmd /c or in batch program),
|
||||||
else
|
or for console applications */
|
||||||
{
|
if (assumeInternal || !interactive || (console && !HIWORD(console)))
|
||||||
/* Always wait when non-interactive (cmd /c or in batch program),
|
WaitForSingleObject (pe.hProcess, INFINITE);
|
||||||
or for console applications */
|
GetExitCodeProcess (pe.hProcess, &errorlevel);
|
||||||
if (assumeInternal || !interactive || !HIWORD(console))
|
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
|
||||||
WaitForSingleObject (pe.hProcess, INFINITE);
|
|
||||||
GetExitCodeProcess (pe.hProcess, &errorlevel);
|
|
||||||
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
|
|
||||||
}
|
|
||||||
CloseHandle(pe.hProcess);
|
CloseHandle(pe.hProcess);
|
||||||
CloseHandle(pe.hThread);
|
CloseHandle(pe.hThread);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue