Skip to content

Commit 95b9286

Browse files
committed
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
1 parent 2d66014 commit 95b9286

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libs/binder/tests/binderLibTest.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ class BinderLibTest : public ::testing::Test {
335335
}
336336

337337
bool checkFreezeSupport() {
338-
std::ifstream freezer_file("/sys/fs/cgroup/uid_0/cgroup.freeze");
338+
std::string path;
339+
if (!CgroupGetAttributePathForTask("FreezerState", getpid(), &path)) {
340+
return false;
341+
}
342+
343+
std::ifstream freezer_file(path);
339344
// Pass test on devices where the cgroup v2 freezer is not supported
340345
if (freezer_file.fail()) {
341346
return false;

0 commit comments

Comments
 (0)