]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: fix is_lxcfs() and is_cgroupfs() 1100/head
authorChristian Brauner <cbrauner@suse.de>
Mon, 25 Jul 2016 15:10:47 +0000 (17:10 +0200)
committerChristian Brauner <cbrauner@suse.de>
Mon, 25 Jul 2016 15:17:39 +0000 (17:17 +0200)
Both functions advertise that they return true when strncmp() == 0 and false
when strncmp() != 0 but so far they returned the exact opposite.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
src/lxc/cgfsng.c

index 0ea7b392e639b60e68bb119e2bf702cf00dcacb6..16a94575609cc1fc844dffda05da11f3b630a701 100644 (file)
@@ -438,7 +438,7 @@ static bool is_lxcfs(const char *line)
        char *p = strstr(line, " - ");
        if (!p)
                return false;
-       return strncmp(p, " - fuse.lxcfs ", 14);
+       return strncmp(p, " - fuse.lxcfs ", 14) == 0;
 }
 
 /*
@@ -488,7 +488,7 @@ static bool is_cgroupfs(char *line)
        char *p = strstr(line, " - ");
        if (!p)
                return false;
-       return strncmp(p, " - cgroup ", 10);
+       return strncmp(p, " - cgroup ", 10) == 0;
 }
 
 /* Add a controller to our list of hierarchies */
@@ -1350,7 +1350,7 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
                        free(controllerpath);
                        goto bad;
                }
-               
+
                r = do_secondstage_mounts_if_needed(type, h, controllerpath, path2,
                                                    d->container_cgroup);
                free(controllerpath);