aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-07-12 19:16:39 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-07-12 19:16:39 +0000
commitd4bc7e2c15fc73187a868fd767d14517249fa8ba (patch)
tree15a71b2cbebeacc001c5a335b8c522f2aef55fbf
parent553d2ca2add27e6c09e085b5a5e5d2767a6b26ab (diff)
downloadpaludis-d4bc7e2c15fc73187a868fd767d14517249fa8ba.tar.gz
paludis-d4bc7e2c15fc73187a868fd767d14517249fa8ba.tar.xz
Notice when a command dies with a signal.
-rw-r--r--paludis/util/output_wrapper.cc2
-rw-r--r--paludis/util/pstream.cc2
-rw-r--r--paludis/util/system.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/paludis/util/output_wrapper.cc b/paludis/util/output_wrapper.cc
index 0fb7914..382f8f2 100644
--- a/paludis/util/output_wrapper.cc
+++ b/paludis/util/output_wrapper.cc
@@ -255,7 +255,7 @@ main(int argc, char *argv[])
std::cerr << argv[0] << ": wait failed: " << strerror(errno) << std::endl;
return EXIT_FAILURE;
}
- return WEXITSTATUS(status);
+ return WIFSIGNALED(status) ? WTERMSIG(status) + 128 : WEXITSTATUS(status);
}
}
diff --git a/paludis/util/pstream.cc b/paludis/util/pstream.cc
index 395248e..20d97fb 100644
--- a/paludis/util/pstream.cc
+++ b/paludis/util/pstream.cc
@@ -175,7 +175,7 @@ PStreamInBuf::exit_status()
Log::get_instance()->message(ll_debug, lc_no_context,
"manual pclose " + stringify(fdn) + " -> " + stringify(_exit_status));
}
- return WEXITSTATUS(_exit_status);
+ return WIFSIGNALED(_exit_status) ? WTERMSIG(_exit_status) + 128 : WEXITSTATUS(_exit_status);
}
void
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 518feac..2be7fe2 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -353,7 +353,7 @@ paludis::run_command(const Command & cmd)
int status(-1);
if (-1 == wait(&status))
throw RunCommandError("wait failed: " + stringify(strerror(errno)));
- return WEXITSTATUS(status);
+ return WIFSIGNALED(status) ? WTERMSIG(status) + 128 : WEXITSTATUS(status);
}
throw InternalError(PALUDIS_HERE, "should never be reached");