[LyX/master] Amend fb7b7e52

Enrico Forestieri forenr at lyx.org
Sun Dec 11 10:25:34 UTC 2022


commit d7910e1870c4e8c427d8854cd68af3ef7de85399
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Sun Dec 11 12:15:37 2022 +0100

    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.
---
 src/support/filetools.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index e24dcba..f7460ce 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


More information about the lyx-cvs mailing list