From: Enrico Forestieri Date: Sun, 11 Dec 2022 11:15:37 +0000 (+0100) Subject: Amend fb7b7e52 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d7910e1870c4e8c427d8854cd68af3ef7de85399;p=features.git Amend fb7b7e52 pclose() returns -1 only in specific cases, otherwise it returns the exit status of the child, to be retrieved by the macro WEXITSTATUS. --- diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index e24dcbaf77..f7460ce188 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -1148,10 +1148,10 @@ cmd_ret const runCommand(string const & cmd) valid = false; #elif defined (HAVE_PCLOSE) int const pret = pclose(inf); - bool const valid = (pret != -1); + bool const valid = (WEXITSTATUS(pret) == 0); #elif defined (HAVE__PCLOSE) int const pret = _pclose(inf); - bool const valid = (pret != -1); + bool const valid = (WEXITSTATUS(pret) == 0); #else #error No pclose() function. #endif