cgfsng: cgfsng_escape()

parent 4fd41ab1
...@@ -2296,7 +2296,7 @@ static int cgfsng_nrtasks(void *hdata) ...@@ -2296,7 +2296,7 @@ static int cgfsng_nrtasks(void *hdata)
return count; 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() static bool cgfsng_escape()
{ {
int i; int i;
...@@ -2305,11 +2305,15 @@ static bool cgfsng_escape() ...@@ -2305,11 +2305,15 @@ static bool cgfsng_escape()
return true; return true;
for (i = 0; hierarchies[i]; i++) { for (i = 0; hierarchies[i]; i++) {
char *fullpath = must_make_path(hierarchies[i]->mountpoint, int ret;
hierarchies[i]->base_cgroup, char *fullpath;
"cgroup.procs", NULL);
if (lxc_write_to_file(fullpath, "0", 2, false) != 0) { fullpath = must_make_path(hierarchies[i]->mountpoint,
SYSERROR("Failed to escape to %s", fullpath); 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); free(fullpath);
return false; return false;
} }
......
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