Mercurial > octave-nkf
changeset 18864:5b7b18d603ae
mkoctfile.in.cc: fix return value if subprocess fails (bug #42549).
* mkoctfile.in.cc (run_command): Use WIFEXITED and WEXITSTATUS macros to
correctly extract return status from system() command.
author | Andreas Weber <andreas.weber@hs-offenburg.de> |
---|---|
date | Fri, 13 Jun 2014 11:28:03 +0200 |
parents | 4ae67c0553ae |
children | 5eca3080c7cd |
files | src/mkoctfile.in.cc |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mkoctfile.in.cc Fri Jun 13 08:21:28 2014 -0700 +++ b/src/mkoctfile.in.cc Fri Jun 13 11:28:03 2014 +0200 @@ -344,7 +344,10 @@ { if (debug) std::cout << cmd << std::endl; - return system (cmd.c_str ()); + int result = system (cmd.c_str ()); + if (WIFEXITED (result)) + result = WEXITSTATUS (result); + return result; } bool