lmkd: use libprocessgroup to kill forked processes

After sending sigkill to the main process, also call into
libprocessgroup to kill any processes that were forked.

Bug: 15313911
Change-Id: I05577c6f5b70800ce0a01f480c8870c2c601afda
This commit is contained in:
Colin Cross 2014-06-11 14:53:41 -07:00
parent cf8d1c22f7
commit fef9522d9b
2 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := lmkd.c
LOCAL_SHARED_LIBRARIES := libcutils liblog libm libc
LOCAL_SHARED_LIBRARIES := libcutils liblog libm libc libprocessgroup
LOCAL_CFLAGS := -Werror
LOCAL_MODULE := lmkd

View File

@ -32,6 +32,7 @@
#include <cutils/sockets.h>
#include <log/log.h>
#include <processgroup/processgroup.h>
#ifndef __unused
#define __unused __attribute__((__unused__))
@ -591,6 +592,7 @@ static void mp_event(uint32_t events __unused) {
other_file * page_k, minfree * page_k, min_score_adj,
other_free * page_k, other_free >= 0 ? "above" : "below");
r = kill(pid, SIGKILL);
killProcessGroup(uid, pid, SIGKILL);
pid_remove(pid);
if (r) {