]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxccontainer: use correct error checks
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 21:15:43 +0000 (22:15 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 2 Feb 2021 21:15:43 +0000 (22:15 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 6879a1765b4f3c56eec892cc326e8f23a6b1c8e6..2f2410c52583c6c1b68d5b86573101df7a7345b0 100644 (file)
@@ -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;
@@ -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;