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

Commit b0947e00 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

libprocessgroup: Proceed if activation of an optional controller fails



Not all Android kernels support all the cgroup controllers mentioned in
task_profiles.json and/or cgroups.json. Support such kernels by ignoring
certain cgroup activation failures.

Bug: 213617178
Change-Id: I90c0bd959f8a6484c4f2fbc895845e073527271e
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 1ec6ec4f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -234,10 +234,15 @@ int CgroupMap::ActivateControllers(const std::string& path) const {
                std::string str("+");
                str.append(ACgroupController_getName(controller));
                if (!WriteStringToFile(str, path + "/cgroup.subtree_control")) {
                    if (flags & CGROUPRC_CONTROLLER_FLAG_OPTIONAL) {
                        PLOG(WARNING) << "Activation of cgroup controller " << str
                                      << " failed in path " << path;
                    } else {
                        return -errno;
                    }
                }
            }
        }
        return 0;
    }
    return -ENOSYS;