diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2020-11-28 11:22:23 (GMT) |
---|---|---|
committer | Jan Niklas Hasse <jhasse@bixense.com> | 2020-11-28 11:22:23 (GMT) |
commit | 9cf70a20685ac3bd48fceac2ea268d449c7e78d5 (patch) | |
tree | 433402b91ee03f5a476da5c0bdb26f6d3bad7809 /src/subprocess-posix.cc | |
parent | a1f879b29c9aafe6a2bc0ba885701f8f4f19f772 (diff) | |
parent | ed056bdd8c8d578a9952bd93b76f29c14199c85b (diff) | |
download | Ninja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.zip Ninja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.tar.gz Ninja-9cf70a20685ac3bd48fceac2ea268d449c7e78d5.tar.bz2 |
Merge branch 'master' into release
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r-- | src/subprocess-posix.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc index 74785d1..8e78540 100644 --- a/src/subprocess-posix.cc +++ b/src/subprocess-posix.cc @@ -34,6 +34,8 @@ extern char** environ; #include "util.h" +using namespace std; + Subprocess::Subprocess(bool use_console) : fd_(-1), pid_(-1), use_console_(use_console) { } @@ -152,6 +154,16 @@ ExitStatus Subprocess::Finish() { Fatal("waitpid(%d): %s", pid_, strerror(errno)); pid_ = -1; +#ifdef _AIX + if (WIFEXITED(status) && WEXITSTATUS(status) & 0x80) { + // Map the shell's exit code used for signal failure (128 + signal) to the + // status code expected by AIX WIFSIGNALED and WTERMSIG macros which, unlike + // other systems, uses a different bit layout. + int signal = WEXITSTATUS(status) & 0x7f; + status = (signal << 16) | signal; + } +#endif + if (WIFEXITED(status)) { int exit = WEXITSTATUS(status); if (exit == 0) |