summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-11-25 16:33:53 -0800
committerElliott Hughes <enh@google.com>2013-11-25 16:33:53 -0800
commit6c5ad5c2ced5e2f1dc31448ef3e0c0fb14f9ada8 (patch)
tree627d548e7467bd72f308116636c7389f671eeaf4
parent71f2f2514ee40a6d9b66545049855ab371955bed (diff)
downloadsystem_core-6c5ad5c2ced5e2f1dc31448ef3e0c0fb14f9ada8.zip
system_core-6c5ad5c2ced5e2f1dc31448ef3e0c0fb14f9ada8.tar.gz
system_core-6c5ad5c2ced5e2f1dc31448ef3e0c0fb14f9ada8.tar.bz2
Make init distinguish between orderly exit and being killed by signals.
Bug: 11826724 Change-Id: I7c11f602447dbd6862decc51cdfe883003cf7d67
-rw-r--r--init/signal_handler.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/init/signal_handler.c b/init/signal_handler.c
index d31ad63..7e8e1a7 100644
--- a/init/signal_handler.c
+++ b/init/signal_handler.c
@@ -57,7 +57,15 @@ static int wait_for_one_process(int block)
svc = service_find_by_pid(pid);
if (!svc) {
- ERROR("untracked pid %d exited\n", pid);
+ if (WIFEXITED(status)) {
+ ERROR("untracked pid %d exited with status %d\n", pid, WEXITSTATUS(status));
+ } else if (WIFSIGNALED(status)) {
+ ERROR("untracked pid %d killed by signal %d\n", pid, WTERMSIG(status));
+ } else if (WIFSTOPPED(status)) {
+ ERROR("untracked pid %d stopped by signal %d\n", pid, WSTOPSIG(status));
+ } else {
+ ERROR("untracked pid %d state changed\n", pid);
+ }
return 0;
}