Our mkdir_p ignore eexist, and of course we want that for
upper path components, but the final directory itself must
not already exist.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname)
{
h->fullcgpath = must_make_path(h->mountpoint, h->base_cgroup, cgname, NULL);
+ if (dir_exists(h->fullcgpath)) // it must not already exist
+ return false;
if (!handle_cpuset_hierarchy(h, cgname))
return false;
return mkdir_p(h->fullcgpath, 0755) == 0;