cgroups: tweak lxc.cgroup.use handling in __cgroup_init()

parent 42d19341
...@@ -3491,7 +3491,7 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf) ...@@ -3491,7 +3491,7 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf)
{ {
__do_close int dfd = -EBADF; __do_close int dfd = -EBADF;
int ret; int ret;
const char *tmp; const char *controllers_use;
if (ops->dfd_mnt_cgroupfs_host >= 0) if (ops->dfd_mnt_cgroupfs_host >= 0)
return ret_errno(EINVAL); return ret_errno(EINVAL);
...@@ -3506,18 +3506,17 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf) ...@@ -3506,18 +3506,17 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf)
if (dfd < 0) if (dfd < 0)
return syserrno(-errno, "Failed to open " DEFAULT_CGROUP_MOUNTPOINT); return syserrno(-errno, "Failed to open " DEFAULT_CGROUP_MOUNTPOINT);
tmp = lxc_global_config_value("lxc.cgroup.use"); controllers_use = lxc_global_config_value("lxc.cgroup.use");
if (tmp) { if (controllers_use) {
__do_free char *pin = NULL; __do_free char *dup = NULL;
char *chop, *cur; char *it;
pin = strdup(tmp); dup = strdup(controllers_use);
if (!pin) if (!dup)
return -errno; return -errno;
chop = pin;
lxc_iterate_parts(cur, chop, ",") lxc_iterate_parts(it, dup, ",")
must_append_string(&ops->cgroup_use, cur); must_append_string(&ops->cgroup_use, it);
} }
/* /*
......
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