Commit a6f2de7e by dlezcano

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: 's avatarAmy Griffis <amy.griffis@hp.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 91feede1
...@@ -56,13 +56,17 @@ static int create_lxc_directory(const char *dirname) ...@@ -56,13 +56,17 @@ static int create_lxc_directory(const char *dirname)
{ {
char path[MAXPATHLEN]; 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; return -errno;
}
sprintf(path, LXCPATH "/%s", dirname); 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 -errno;
}
return 0; return 0;
} }
......
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