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

Commit 95b92868 authored by T.J. Mercier's avatar T.J. Mercier
Browse files

Use libprocessgroup to find cgroup v2 paths

Cgroup v2 paths are owned by libprocessgroup. Those paths can change
based on build flags, so paths generated outside of libprocessgroup may
not always be correct.

Bug: 382693152
Test: atest binderLibTest
Change-Id: Iefbf6716f657a6d2505cb760702de7401e220134
parent 2d660145
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -335,7 +335,12 @@ class BinderLibTest : public ::testing::Test {
        }

        bool checkFreezeSupport() {
            std::ifstream freezer_file("/sys/fs/cgroup/uid_0/cgroup.freeze");
            std::string path;
            if (!CgroupGetAttributePathForTask("FreezerState", getpid(), &path)) {
                return false;
            }

            std::ifstream freezer_file(path);
            // Pass test on devices where the cgroup v2 freezer is not supported
            if (freezer_file.fail()) {
                return false;