cgroups/cgfsng: rework cgfsng_{monitor,payload}_delegate_controllers()

parent 50a48614
...@@ -2838,10 +2838,10 @@ bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cgroup) ...@@ -2838,10 +2838,10 @@ bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cgroup)
base_path = must_append_path(base_path, parts[i], NULL); base_path = must_append_path(base_path, parts[i], NULL);
target = must_make_path(base_path, "cgroup.subtree_control", NULL); target = must_make_path(base_path, "cgroup.subtree_control", NULL);
ret = lxc_writeat(-1, target, add_controllers, full_len); ret = lxc_writeat(-1, target, add_controllers, full_len);
if (ret < 0) { if (ret < 0)
SYSERROR("Could not enable \"%s\" controllers in the unified cgroup \"%s\"", add_controllers, target); log_error_errno(goto on_error,
goto on_error; errno, "Could not enable \"%s\" controllers in the unified cgroup \"%s\"",
} add_controllers, target);
TRACE("Enable \"%s\" controllers in the unified cgroup \"%s\"", add_controllers, target); TRACE("Enable \"%s\" controllers in the unified cgroup \"%s\"", add_controllers, target);
} }
...@@ -2854,11 +2854,17 @@ on_error: ...@@ -2854,11 +2854,17 @@ on_error:
__cgfsng_ops bool cgfsng_monitor_delegate_controllers(struct cgroup_ops *ops) __cgfsng_ops bool cgfsng_monitor_delegate_controllers(struct cgroup_ops *ops)
{ {
if (!ops)
return ret_set_errno(false, ENOENT);
return __cgfsng_delegate_controllers(ops, ops->monitor_cgroup); return __cgfsng_delegate_controllers(ops, ops->monitor_cgroup);
} }
__cgfsng_ops bool cgfsng_payload_delegate_controllers(struct cgroup_ops *ops) __cgfsng_ops bool cgfsng_payload_delegate_controllers(struct cgroup_ops *ops)
{ {
if (!ops)
return ret_set_errno(false, ENOENT);
return __cgfsng_delegate_controllers(ops, ops->container_cgroup); return __cgfsng_delegate_controllers(ops, ops->container_cgroup);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment