summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-08-24 13:01:23 +0800
committerJohn Hodge <tpg@mutabah.net>2017-08-24 13:01:23 +0800
commitcc6ded45c7915b142c61280dcc25d941a653a522 (patch)
tree4951ac7563c15d4ef538f3c3a988d0332f7c6804
parent9ba0885575b2549f1c05a7ae64edd63ba0e0d58c (diff)
downloadmrust-cc6ded45c7915b142c61280dcc25d941a653a522.tar.gz
minicargo build - Fix exit detection
-rw-r--r--tools/minicargo/build.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/minicargo/build.cpp b/tools/minicargo/build.cpp
index 4088147f..50f29db3 100644
--- a/tools/minicargo/build.cpp
+++ b/tools/minicargo/build.cpp
@@ -392,9 +392,14 @@ bool Builder::spawn_process(const StringList& args, const ::helpers::path& logfi
posix_spawn_file_actions_destroy(&fa);
int status = -1;
waitpid(pid, &status, 0);
- if( WEXITSTATUS(status) != 0 )
+ if( status != 0 )
{
- DEBUG("Compiler exited with non-zero exit status " << WEXITSTATUS(status));
+ if( WIFEXITED(status) )
+ DEBUG("Compiler exited with non-zero exit status " << WEXITSTATUS(status));
+ else if( WIFSIGNALED(status) )
+ DEBUG("Compiler was terminated with signal " << WSTOPSIG(status));
+ else
+ DEBUG("Compiler terminated for unknown reason, status=" << status);
return false;
}
#endif