From: Christian Brauner Date: Sat, 17 Feb 2018 18:14:14 +0000 (+0100) Subject: cgfsng: cg_hybrid_get_mountpoint() X-Git-Tag: lxc-2.0.10~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=533bccb97cce302cad0f89c53dcc5d0604c80077;p=thirdparty%2Flxc.git cgfsng: cg_hybrid_get_mountpoint() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index d3f4593f7..c64f86df2 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -955,17 +955,15 @@ static struct hierarchy *add_hierarchy(char **clist, char *mountpoint, return new; } -/* - * Get a copy of the mountpoint from @line, which is a line from - * /proc/self/mountinfo +/* Get a copy of the mountpoint from @line, which is a line from + * /proc/self/mountinfo. */ static char *cg_hybrid_get_mountpoint(char *line) { int i; - char *p2; size_t len; - char *p = line; - char *sret = NULL; + char *p2; + char *p = line, *sret = NULL; for (i = 0; i < 4; i++) { p = strchr(p, ' '); @@ -974,7 +972,7 @@ static char *cg_hybrid_get_mountpoint(char *line) p++; } - if (strncmp(p, "/sys/fs/cgroup/", 15)) + if (strncmp(p, "/sys/fs/cgroup/", 15) != 0) return NULL; p2 = strchr(p + 15, ' ');