From: Christian Brauner Date: Sat, 17 Feb 2018 18:41:04 +0000 (+0100) Subject: cgfsng: cgfsng_escape() X-Git-Tag: lxc-3.0.0.beta1~22^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11c238679785520014dfe4fab772d98f9dd8e501;p=thirdparty%2Flxc.git cgfsng: cgfsng_escape() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 7c2b1d7ab..81b340b66 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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; }