From: Christian Brauner Date: Tue, 2 Feb 2021 21:15:43 +0000 (+0100) Subject: lxccontainer: use correct error checks X-Git-Tag: lxc-5.0.0~305^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=739af8478c105d8155f326946f741a24ee887059;p=thirdparty%2Flxc.git lxccontainer: use correct error checks Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 6879a1765..2f2410c52 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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;