From 193697db4eebd444191980e7d3a063a86fdcf213 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Sat, 24 Aug 2002 20:11:38 +0000 Subject: [PATCH] Dont return an error if the directory already existed --- libbb/make_directory.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 668fea7..1c3026c 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c @@ -57,8 +57,12 @@ int make_directory (char *path, long mode, int flags) } } ret = mkdir(path, mode); - if ( (ret == -1) && (errno != EEXIST) ) { - perror_msg("Cannot create directory %s", path); + if (ret == -1) { + if (errno == EEXIST) { + ret = 0; + } else { + perror_msg("Cannot create directory %s", path); + } } - return ret; + return(ret); } -- 2.7.4