diff options
author | Elliott Hughes <enh@google.com> | 2016-08-02 23:10:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-02 23:10:29 +0000 |
commit | 963de553421a94a449c74f8b13ff3aa57d646cdf (patch) | |
tree | 37ee44586542c751096b9e896d51d2c6b8a2644b /init | |
parent | 5c72c9688ffaee88fcef90d0c34998115d32fa42 (diff) | |
parent | 9a5300fcb899d1b1a4118e2d050480b6146e96ea (diff) | |
download | core-963de553421a94a449c74f8b13ff3aa57d646cdf.tar.gz core-963de553421a94a449c74f8b13ff3aa57d646cdf.tar.bz2 core-963de553421a94a449c74f8b13ff3aa57d646cdf.zip |
Merge "Have init kill the process group."
am: 9a5300fcb8
Change-Id: I692c5fabfaea39e7ed6c9de5f6ad245330e3442c
Diffstat (limited to 'init')
-rw-r--r-- | init/service.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/init/service.cpp b/init/service.cpp index 44d9d8c77..32aafd61b 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -197,11 +197,15 @@ void Service::NotifyStateChange(const std::string& new_state) const { } void Service::KillProcessGroup(int signal) { - LOG(VERBOSE) << "Sending signal " << signal - << " to service '" << name_ - << "' (pid " << pid_ << ") process group...\n", - kill(pid_, signal); - killProcessGroup(uid_, pid_, signal); + LOG(INFO) << "Sending signal " << signal + << " to service '" << name_ + << "' (pid " << pid_ << ") process group..."; + if (killProcessGroup(uid_, pid_, signal) == -1) { + PLOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed"; + } + if (kill(-pid_, signal) == -1) { + PLOG(ERROR) << "kill(" << pid_ << ", " << signal << ") failed"; + } } void Service::CreateSockets(const std::string& context) { |