From: Christian Brauner Date: Sat, 7 Dec 2019 23:20:02 +0000 (+0100) Subject: cgroups/cgfsng: rework cgfsng_unfreeze() X-Git-Tag: lxc-4.0.0~78^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bdf9691525b11f5a418a04fee363875901bb295;p=thirdparty%2Flxc.git cgroups/cgfsng: rework cgfsng_unfreeze() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index a3611c130..3cb2fe08d 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2176,18 +2176,19 @@ __cgfsng_ops static int cgfsng_unfreeze(struct cgroup_ops *ops, int timeout) } __cgfsng_ops static const char *cgfsng_get_cgroup(struct cgroup_ops *ops, - const char *controller) + const char *controller) { struct hierarchy *h; h = get_hierarchy(ops, controller); - if (!h) { - WARN("Failed to find hierarchy for controller \"%s\"", - controller ? controller : "(null)"); - return NULL; - } + if (!h) + return log_warn_errno(NULL, + ENOENT, "Failed to find hierarchy for controller \"%s\"", + controller ? controller : "(null)"); - return h->container_full_path ? h->container_full_path + strlen(h->mountpoint) : NULL; + return h->container_full_path + ? h->container_full_path + strlen(h->mountpoint) + : NULL; } /* Given a cgroup path returned from lxc_cmd_get_cgroup_path, build a full path,