Merge "send SIGTERM only once" am: 9ead7c4a74 am: ba54f32b0a

am: 72d44ae00c

Change-Id: I31b6064ae5625a1f6cd1b34c57085a18d870be27
This commit is contained in:
Keun-young Park 2017-03-30 04:19:35 +00:00 committed by android-build-merger
commit 1bcca04d6b

View file

@ -211,7 +211,13 @@ void Service::KillProcessGroup(int signal) {
LOG(INFO) << "Sending signal " << signal
<< " to service '" << name_
<< "' (pid " << pid_ << ") process group...";
if (killProcessGroup(uid_, pid_, signal) == -1) {
int r;
if (signal == SIGTERM) {
r = killProcessGroupOnce(uid_, pid_, signal);
} else {
r = killProcessGroup(uid_, pid_, signal);
}
if (r == -1) {
PLOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed";
}
if (kill(-pid_, signal) == -1) {