# HG changeset patch # User Andreas Weber # Date 1402651683 -7200 # Node ID 5b7b18d603ae07299ac5be59521b8833c6b182de # Parent 4ae67c0553ae83823b4749d322094acf2e18c55b 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. diff --git a/src/mkoctfile.in.cc b/src/mkoctfile.in.cc --- a/src/mkoctfile.in.cc +++ b/src/mkoctfile.in.cc @@ -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