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

index 5dd5c3ec50ac9820f35b1c84dbdb7c027a2e0563..79952ffffd8e605784fa8593a80c8996366cc4cb 100644 (file)
@@ -2131,10 +2131,9 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
 {
        int i, ret;
        char *tmpfspath = NULL;
-       bool retval = false;
+       bool has_cgns = false, retval = false, wants_force_mount = false;
        struct lxc_handler *handler = hdata;
        struct cgfsng_handler_data *d = handler->cgroup_data;
-       bool has_cgns = false, wants_force_mount = false;
 
        if ((type & LXC_AUTO_CGROUP_MASK) == 0)
                return true;
@@ -2176,11 +2175,13 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
                if (!controller)
                        continue;
                controller++;
+
                controllerpath = must_make_path(tmpfspath, controller, NULL);
                if (dir_exists(controllerpath)) {
                        free(controllerpath);
                        continue;
                }
+
                ret = mkdir(controllerpath, 0755);
                if (ret < 0) {
                        SYSERROR("Error creating cgroup path: %s", controllerpath);
@@ -2221,8 +2222,8 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
                        goto on_error;
                }
 
-               ret = do_secondstage_mounts_if_needed(
-                   type, h, controllerpath, path2, d->container_cgroup);
+               ret = do_secondstage_mounts_if_needed(type, h, controllerpath,
+                                                     path2, d->container_cgroup);
                free(controllerpath);
                free(path2);
                if (ret < 0)