From a6f2de7e5e76ae69dc8df30cc70ee95b05a32127 Mon Sep 17 00:00:00 2001 From: dlezcano Date: Thu, 8 Jan 2009 08:30:58 +0000 Subject: [PATCH] more info on failure to create directory From: Amy Griffis Add error handling similar to remove_lxc_directory(). Signed-off-by: Amy Griffis Signed-off-by: Daniel Lezcano --- src/lxc/create.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lxc/create.c b/src/lxc/create.c index 32aa4f64a..89d46c446 100644 --- a/src/lxc/create.c +++ b/src/lxc/create.c @@ -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; } -- 2.47.2