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

index d5419ecd9074d13ee6e05816483f4036fd581c26..e2664decc8733ce4561bfde37657e72911618b7f 100644 (file)
@@ -964,17 +964,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, ' ');
@@ -983,7 +981,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, ' ');