more info on failure to create directory

From: Amy Griffis <amy.griffis@hp.com>

Add error handling similar to remove_lxc_directory().

Signed-off-by: Amy Griffis <amy.griffis@hp.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
dlezcano 2009-01-08 08:30:58 +00:00
parent 91feede190
commit a6f2de7e5e

View File

@ -56,13 +56,17 @@ static int create_lxc_directory(const char *dirname)
{
char path[MAXPATHLEN];
if (mkdir(LXCPATH, 0755) && errno != EEXIST)
if (mkdir(LXCPATH, 0755) && errno != EEXIST) {
lxc_log_syserror("failed to create %s directory", LXCPATH);
return -errno;
}
sprintf(path, LXCPATH "/%s", dirname);
if (mkdir(path, 0755))
if (mkdir(path, 0755)) {
lxc_log_syserror("failed to create %s directory", path);
return -errno;
}
return 0;
}