Skip to content

Commit

Permalink
lxccontainer: use correct error checks
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 2, 2021
1 parent b57f9b1 commit 739af84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/lxccontainer.c
Expand Up @@ -3295,7 +3295,7 @@ static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsy
return false;

ret = cgroup_set(c->name, c->config_path, subsys, value);
if (ret == ENOCGROUP2) {
if (ret == -ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops)
return false;
Expand All @@ -3320,7 +3320,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys
return -1;

ret = cgroup_get(c->name, c->config_path, subsys, retv, inlen);
if (ret == ENOCGROUP2) {
if (ret == -ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops)
return -1;
Expand Down

0 comments on commit 739af84

Please sign in to comment.