diff options
author | Elliott Hughes <enh@google.com> | 2013-11-26 18:42:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-11-26 18:42:23 +0000 |
commit | 121400a40fce22b6e0b74f2492b8b9eff6133bd1 (patch) | |
tree | d93d417e004ed6d2d5158c4e046b4e4cc0370ff3 | |
parent | e456d420a5bdd1085f587a7906b58aabcb43f220 (diff) | |
parent | 6c5ad5c2ced5e2f1dc31448ef3e0c0fb14f9ada8 (diff) | |
download | core-121400a40fce22b6e0b74f2492b8b9eff6133bd1.tar.gz |
Merge "Make init distinguish between orderly exit and being killed by signals."
-rw-r--r-- | init/signal_handler.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/init/signal_handler.c b/init/signal_handler.c index d31ad63c8..7e8e1a70a 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; } |