cgroups/cgfsng: rework cgfsng_mount()

parent 48ee0f07
...@@ -1783,9 +1783,15 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, ...@@ -1783,9 +1783,15 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
int ret; int ret;
bool has_cgns = false, retval = false, wants_force_mount = false; bool has_cgns = false, retval = false, wants_force_mount = false;
if (!ops)
return ret_set_errno(false, ENOENT);
if (!ops->hierarchies) if (!ops->hierarchies)
return true; return true;
if (!handler || !handler->conf)
return ret_set_errno(false, EINVAL);
if ((type & LXC_AUTO_CGROUP_MASK) == 0) if ((type & LXC_AUTO_CGROUP_MASK) == 0)
return true; return true;
...@@ -1845,10 +1851,10 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, ...@@ -1845,10 +1851,10 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
continue; continue;
ret = mkdir(controllerpath, 0755); ret = mkdir(controllerpath, 0755);
if (ret < 0) { if (ret < 0)
SYSERROR("Error creating cgroup path: %s", controllerpath); log_error_errno(goto on_error, errno,
goto on_error; "Error creating cgroup path: %s",
} controllerpath);
if (has_cgns && wants_force_mount) { if (has_cgns && wants_force_mount) {
/* If cgroup namespaces are supported but the container /* If cgroup namespaces are supported but the container
......
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