cgfsng: cgfsng_mount()

parent 643b9674
...@@ -2131,10 +2131,9 @@ static bool cgfsng_mount(void *hdata, const char *root, int type) ...@@ -2131,10 +2131,9 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
{ {
int i, ret; int i, ret;
char *tmpfspath = NULL; char *tmpfspath = NULL;
bool retval = false; bool has_cgns = false, retval = false, wants_force_mount = false;
struct lxc_handler *handler = hdata; struct lxc_handler *handler = hdata;
struct cgfsng_handler_data *d = handler->cgroup_data; struct cgfsng_handler_data *d = handler->cgroup_data;
bool has_cgns = false, wants_force_mount = false;
if ((type & LXC_AUTO_CGROUP_MASK) == 0) if ((type & LXC_AUTO_CGROUP_MASK) == 0)
return true; return true;
...@@ -2176,11 +2175,13 @@ static bool cgfsng_mount(void *hdata, const char *root, int type) ...@@ -2176,11 +2175,13 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
if (!controller) if (!controller)
continue; continue;
controller++; controller++;
controllerpath = must_make_path(tmpfspath, controller, NULL); controllerpath = must_make_path(tmpfspath, controller, NULL);
if (dir_exists(controllerpath)) { if (dir_exists(controllerpath)) {
free(controllerpath); free(controllerpath);
continue; continue;
} }
ret = mkdir(controllerpath, 0755); ret = mkdir(controllerpath, 0755);
if (ret < 0) { if (ret < 0) {
SYSERROR("Error creating cgroup path: %s", controllerpath); SYSERROR("Error creating cgroup path: %s", controllerpath);
...@@ -2221,8 +2222,8 @@ static bool cgfsng_mount(void *hdata, const char *root, int type) ...@@ -2221,8 +2222,8 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
goto on_error; goto on_error;
} }
ret = do_secondstage_mounts_if_needed( ret = do_secondstage_mounts_if_needed(type, h, controllerpath,
type, h, controllerpath, path2, d->container_cgroup); path2, d->container_cgroup);
free(controllerpath); free(controllerpath);
free(path2); free(path2);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment