From 6bdf9691525b11f5a418a04fee363875901bb295 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 8 Dec 2019 00:20:02 +0100 Subject: [PATCH] cgroups/cgfsng: rework cgfsng_unfreeze() Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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, -- 2.47.2