]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: cgfsng_escape()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 17 Feb 2018 18:41:04 +0000 (19:41 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 17 Feb 2018 18:41:04 +0000 (19:41 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 7c2b1d7aba925047b7db64e794fd28e3969c3029..81b340b6697f9be925980d03bb132c42cda35d16 100644 (file)
@@ -2318,7 +2318,7 @@ static int cgfsng_nrtasks(void *hdata)
        return count;
 }
 
-/* Only root needs to escape to the cgroup of its init */
+/* Only root needs to escape to the cgroup of its init. */
 static bool cgfsng_escape()
 {
        int i;
@@ -2327,11 +2327,15 @@ static bool cgfsng_escape()
                return true;
 
        for (i = 0; hierarchies[i]; i++) {
-               char *fullpath = must_make_path(hierarchies[i]->mountpoint,
-                                               hierarchies[i]->base_cgroup,
-                                               "cgroup.procs", NULL);
-               if (lxc_write_to_file(fullpath, "0", 2, false) != 0) {
-                       SYSERROR("Failed to escape to %s", fullpath);
+               int ret;
+               char *fullpath;
+
+               fullpath = must_make_path(hierarchies[i]->mountpoint,
+                                         hierarchies[i]->base_cgroup,
+                                         "cgroup.procs", NULL);
+               ret = lxc_write_to_file(fullpath, "0", 2, false);
+               if (ret != 0) {
+                       SYSERROR("Failed to escape to cgroup \"%s\"", fullpath);
                        free(fullpath);
                        return false;
                }