Commit e7f40d8a by Stéphane Graber

When creating the lxc cgroup directory, ignore -EEXIST

Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com
parent f02ce27d
......@@ -419,9 +419,12 @@ static int lxc_one_cgroup_create(const char *name,
}
/* if cgparent does not exist, create it */
if (access(cgparent, F_OK) && mkdir(cgparent, 0755)) {
SYSERROR("failed to create '%s' directory", cgparent);
return -1;
if (access(cgparent, F_OK)) {
ret = mkdir(cgparent, 0755);
if (ret == -1 && errno == EEXIST) {
SYSERROR("failed to create '%s' directory", cgparent);
return -1;
}
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment