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

Commit 6539c5f3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libprocessgroup: Remove isolated UID cgroup directories" into main am:...

Merge "libprocessgroup: Remove isolated UID cgroup directories" into main am: 30718e74 am: 3cc3e8d4 am: 111e2eb3 am: 7024acc7

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



Change-Id: I354b7e6062afb1c35f97d265db4e9ec9cac69662
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4b8bdf30 7024acc7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -223,6 +223,13 @@ static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid, unsigned i
        std::this_thread::sleep_for(5ms);
    }

    if (!ret && uid >= AID_ISOLATED_START && uid <= AID_ISOLATED_END) {
        // Isolated UIDs are unlikely to be reused soon after removal,
        // so free up the kernel resources for the UID level cgroup.
        const auto uid_path = ConvertUidToPath(cgroup, uid);
        ret = rmdir(uid_path.c_str());
    }

    return ret;
}