aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-02-25 09:17:44 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-02-25 09:17:44 +0000
commit42d6cdd371dc482bf423737a8024cdb064f98b87 (patch)
tree52b882926b198d03c8d13ba46a45b635ae887a48 /bin
parent2ca2159f22cccc13d6085d34bd5ed57a8b2346b1 (diff)
downloadsrc-42d6cdd371dc482bf423737a8024cdb064f98b87.tar.gz
src-42d6cdd371dc482bf423737a8024cdb064f98b87.zip
Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system
call returns `EISDIR', not `EEXIST', so that be prepared for that. This should fix number of ports, that often call `mkdir -p //usr/local/foobar'. This is just a quick workaround, the real fix would be either to avoid calling mkdir("/", ...) or fix VFS code to return consistent errno for this case.
Notes
Notes: svn path=/head/; revision=91235
Diffstat (limited to 'bin')
-rw-r--r--bin/mkdir/mkdir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 17e7ccf446fc..5f865883e91b 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -174,7 +174,7 @@ build(char *path, mode_t omode)
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
- if (errno == EEXIST) {
+ if (errno == EEXIST || errno == EISDIR) {
if (stat(path, &sb) < 0) {
warn("%s", path);
retval = 1;