mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix exit code from runCommand on Windows
On Windows, runCommand has never returned the exit code of the spawned process but the result of correctly closing the input handle. Fixes #10327
This commit is contained in:
parent
2a371bb4b3
commit
fb46b3a1ee
@ -1071,10 +1071,14 @@ cmd_ret const runCommand(string const & cmd)
|
|||||||
|
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
WaitForSingleObject(process.hProcess, INFINITE);
|
WaitForSingleObject(process.hProcess, INFINITE);
|
||||||
|
DWORD pret;
|
||||||
|
if (!GetExitCodeProcess(process.hProcess, &pret))
|
||||||
|
pret = -1;
|
||||||
if (!infile.empty())
|
if (!infile.empty())
|
||||||
CloseHandle(startup.hStdInput);
|
CloseHandle(startup.hStdInput);
|
||||||
CloseHandle(process.hProcess);
|
CloseHandle(process.hProcess);
|
||||||
int const pret = fclose(inf);
|
if (fclose(inf) != 0)
|
||||||
|
pret = -1;
|
||||||
#elif defined (HAVE_PCLOSE)
|
#elif defined (HAVE_PCLOSE)
|
||||||
int const pret = pclose(inf);
|
int const pret = pclose(inf);
|
||||||
#elif defined (HAVE__PCLOSE)
|
#elif defined (HAVE__PCLOSE)
|
||||||
|
Loading…
Reference in New Issue
Block a user