From afd41206228fb8697a4943ea88cb664b18fafa2b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 24 Feb 2013 09:38:46 +0100 Subject: [PATCH] Fixes directory creation. --- util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util.c b/util.c index c4e13f1b..db0b3f04 100644 --- a/util.c +++ b/util.c @@ -679,13 +679,13 @@ int mkancestor(const char* file) } /* try creating it */ - if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) { - /* if it already exists, we are done */ - if (errno == EEXIST) { - return 0; - } - fprintf(stderr, "Error creating directory '%s'. %s.\n", dir, strerror(errno)); - return -1; + if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) { + /* just created */ + return 0; + } + if (errno == EEXIST) { + /* it already exists */ + return 0; } /* recursively create them all */