cgroups: avoid additional variable for single access

parent 37ac0b48
......@@ -3492,7 +3492,6 @@ static int cg_unified_init(struct cgroup_ops *ops, bool relative,
static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf)
{
__do_close int dfd = -EBADF;
bool relative = conf->cgroup_meta.relative;
int ret;
const char *tmp;
......@@ -3529,9 +3528,11 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf)
ops->dfd_mnt_cgroupfs_host = dfd;
if (unified_cgroup_fd(dfd))
ret = cg_unified_init(ops, relative, !lxc_list_empty(&conf->id_map));
ret = cg_unified_init(ops, conf->cgroup_meta.relative,
!lxc_list_empty(&conf->id_map));
else
ret = cg_hybrid_init(ops, relative, !lxc_list_empty(&conf->id_map));
ret = cg_hybrid_init(ops, conf->cgroup_meta.relative,
!lxc_list_empty(&conf->id_map));
if (ret < 0)
return syserrno(ret, "Failed to initialize cgroups");
......
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