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

Commit 6079d301 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I8a2764a6,I6e8b9d63,I6e041dfc

* changes:
  Canonicalize cgroup paths
  Micro-optimize MergeCgroupToDescriptors()
  Fix support for optional cgroup attributes
parents daf60339 d3160206
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -147,12 +147,17 @@ static bool Mkdir(const std::string& path, mode_t mode, const std::string& uid,
static void MergeCgroupToDescriptors(std::map<std::string, CgroupDescriptor>* descriptors,
                                     const Json::Value& cgroup, const std::string& name,
                                     const std::string& root_path, int cgroups_version) {
    const std::string cgroup_path = cgroup["Path"].asString();
    std::string path;

    if (!root_path.empty()) {
        path = root_path + "/" + cgroup["Path"].asString();
        path = root_path;
        if (cgroup_path != ".") {
            path += "/";
            path += cgroup_path;
        }
    } else {
        path = cgroup["Path"].asString();
        path = cgroup_path;
    }

    uint32_t controller_flags = 0;
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ bool SetAttributeAction::ExecuteForTask(int tid) const {
    }

    if (!WriteStringToFile(value_, path)) {
        if (errno == ENOENT) {
        if (access(path.c_str(), F_OK) < 0) {
            if (optional_) {
                return true;
            } else {