Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30827f02 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libprocessgroup: Stop services that have been migrated to another v2...

Merge "libprocessgroup: Stop services that have been migrated to another v2 cgroup" into main am: 57359b73 am: aadad459

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2832972



Change-Id: I3e3ffc4d748bad99f67ed2454ab188baf3c2f059
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7ab97d82 aadad459
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -378,8 +378,11 @@ static int DoKillProcessGroupOnce(const char* cgroup, uid_t uid, int initialPid,
        fd.reset(fopen(path.c_str(), "re"));
        if (!fd) {
            if (errno == ENOENT) {
                // This happens when process is already dead
                return 0;
                // This happens when the process is already dead or if, as the result of a bug, it
                // has been migrated to another cgroup. An example of a bug that can cause migration
                // to another cgroup is using the JoinCgroup action with a cgroup controller that
                // has been activated in the v2 cgroup hierarchy.
                goto kill;
            }
            PLOG(WARNING) << __func__ << " failed to open process cgroup uid " << uid << " pid "
                          << initialPid;
@@ -418,6 +421,7 @@ static int DoKillProcessGroupOnce(const char* cgroup, uid_t uid, int initialPid,
        }
    }

kill:
    // Kill all process groups.
    for (const auto pgid : pgids) {
        LOG(VERBOSE) << "Killing process group " << -pgid << " in uid " << uid