Merge "libprocessgroup: Introduce a local variable in CgroupMap::ActivateControllers()"

This commit is contained in:
Bart Van Assche 2023-02-09 21:38:05 +00:00 committed by Gerrit Code Review
commit d9098252c6

View file

@ -229,8 +229,8 @@ int CgroupMap::ActivateControllers(const std::string& path) const {
auto controller_count = ACgroupFile_getControllerCount();
for (uint32_t i = 0; i < controller_count; ++i) {
const ACgroupController* controller = ACgroupFile_getController(i);
if (ACgroupController_getFlags(controller) &
CGROUPRC_CONTROLLER_FLAG_NEEDS_ACTIVATION) {
const uint32_t flags = ACgroupController_getFlags(controller);
if (flags & CGROUPRC_CONTROLLER_FLAG_NEEDS_ACTIVATION) {
std::string str("+");
str.append(ACgroupController_getName(controller));
if (!WriteStringToFile(str, path + "/cgroup.subtree_control")) {