diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-08-24 20:11:38 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-08-24 20:11:38 +0000 |
commit | 193697db4eebd444191980e7d3a063a86fdcf213 (patch) | |
tree | deef31d51834992e80b0b45741c9fd9cdc90e4eb /libbb/make_directory.c | |
parent | 210aa14916aed0fa4c78197c43578bed49a57350 (diff) | |
download | busybox-w32-193697db4eebd444191980e7d3a063a86fdcf213.tar.gz busybox-w32-193697db4eebd444191980e7d3a063a86fdcf213.tar.bz2 busybox-w32-193697db4eebd444191980e7d3a063a86fdcf213.zip |
Dont return an error if the directory already existed
Diffstat (limited to 'libbb/make_directory.c')
-rw-r--r-- | libbb/make_directory.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 668fea7ff..1c3026ccc 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c | |||
@@ -57,8 +57,12 @@ int make_directory (char *path, long mode, int flags) | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | ret = mkdir(path, mode); | 59 | ret = mkdir(path, mode); |
60 | if ( (ret == -1) && (errno != EEXIST) ) { | 60 | if (ret == -1) { |
61 | perror_msg("Cannot create directory %s", path); | 61 | if (errno == EEXIST) { |
62 | ret = 0; | ||
63 | } else { | ||
64 | perror_msg("Cannot create directory %s", path); | ||
65 | } | ||
62 | } | 66 | } |
63 | return ret; | 67 | return(ret); |
64 | } | 68 | } |