From: Serge Hallyn Date: Tue, 13 Nov 2012 23:17:25 +0000 (-0600) Subject: Fix reverse check: error out only if mkdir(cgroup/lxc) fails NOT due to -EEXIST X-Git-Tag: lxc-0.9.0.alpha1~1^2~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7436fc1dfe0323fb5e6905457f342da5ed8ca97;p=thirdparty%2Flxc.git Fix reverse check: error out only if mkdir(cgroup/lxc) fails NOT due to -EEXIST Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index a02ebc2fa..532d63833 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -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; }