commit d7910e1870c4e8c427d8854cd68af3ef7de85399
Author: Enrico Forestieri <for...@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
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to