commit | 193697db4eebd444191980e7d3a063a86fdcf213 | [log] [tgz] |
---|---|---|
author | Glenn L McGrath <bug1@ihug.co.nz> | Sat Aug 24 20:11:38 2002 +0000 |
committer | Glenn L McGrath <bug1@ihug.co.nz> | Sat Aug 24 20:11:38 2002 +0000 |
tree | deef31d51834992e80b0b45741c9fd9cdc90e4eb | |
parent | 210aa14916aed0fa4c78197c43578bed49a57350 [diff] |
Dont return an error if the directory already existed
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 @@ } } 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); }