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
This commit is contained in:
fengshaobo 2018-09-13 14:57:07 +08:00
parent 4cd979fe67
commit 950f6f367e

View file

@ -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 {