]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups/cgfsng: rework cgfsng_unfreeze()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:20:02 +0000 (00:20 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:28:48 +0000 (00:28 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index a3611c1308fc702fd9ba31b4fe9a609fe3145478..3cb2fe08de70f33caa017d6c1814d0c85279ba16 100644 (file)
@@ -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,