projects
/
platform
/
upstream
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
210aa14
)
Dont return an error if the directory already existed
author
Glenn L McGrath
<bug1@ihug.co.nz>
Sat, 24 Aug 2002 20:11:38 +0000
(20:11 -0000)
committer
Glenn L McGrath
<bug1@ihug.co.nz>
Sat, 24 Aug 2002 20:11:38 +0000
(20:11 -0000)
libbb/make_directory.c
patch
|
blob
|
history
diff --git
a/libbb/make_directory.c
b/libbb/make_directory.c
index
668fea7
..
1c3026c
100644
(file)
--- 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)
;
}