]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix reverse check: error out only if mkdir(cgroup/lxc) fails NOT due to -EEXIST
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Nov 2012 23:17:25 +0000 (17:17 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Nov 2012 23:18:22 +0000 (17:18 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgroup.c

index a02ebc2fa65aa604b2016e43990e5f8c562cb629..532d6383368f19d449448a9d97d9fcda98182c8a 100644 (file)
@@ -542,7 +542,7 @@ static int lxc_one_cgroup_create(const char *name,
        /* if cgparent does not exist, create it */
        if (access(cgparent, F_OK)) {
                ret = mkdir(cgparent, 0755);
-               if (ret == -1 && errno == EEXIST) {
+               if (ret == -1 && errno != EEXIST) {
                        SYSERROR("failed to create '%s' directory", cgparent);
                        return -1;
                }