From: Christian Brauner Date: Sat, 7 Dec 2019 23:20:02 +0000 (+0100) Subject: cgroups/cgfsng: rework cgfsng_unfreeze() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e650b99a88ba5fef357a89bfdeba5c07bac80f18;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 d8239577a..808a27045 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,