From 950f6f367e4725d5d5cb72f63301f2f9d5813de9 Mon Sep 17 00:00:00 2001 From: fengshaobo Date: Thu, 13 Sep 2018 14:57:07 +0800 Subject: [PATCH] Fixed the can not kill some process using libprocessgroup In DoKillProcessGroupOnce function, if process has a child process, pids set will be clear probability and initialPid will not be killed, when the pid is equal to initialPid. Test: manual - start duomi app and remove it use recent apps key Change-Id: Ifb9f4acacd725d2c367e547d2b5512807bb44fec --- libprocessgroup/processgroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp index 1cebb5daa..0a42053df 100644 --- a/libprocessgroup/processgroup.cpp +++ b/libprocessgroup/processgroup.cpp @@ -185,7 +185,7 @@ static int DoKillProcessGroupOnce(uid_t uid, int initialPid, int signal) { // Erase all pids that will be killed when we kill the process groups. for (auto it = pids.begin(); it != pids.end();) { - pid_t pgid = getpgid(pid); + pid_t pgid = getpgid(*it); if (pgids.count(pgid) == 1) { it = pids.erase(it); } else {