summaryrefslogtreecommitdiffstats
path: root/bin/mkdir/mkdir.c
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-02-25 09:17:44 +0000
committersobomax <sobomax@FreeBSD.org>2002-02-25 09:17:44 +0000
commit521f052069e7f7eac849e9e05677ed76a764f2ad (patch)
tree52b882926b198d03c8d13ba46a45b635ae887a48 /bin/mkdir/mkdir.c
parent8b28692f71b5070fbdab8e4f79a9eed8f93abfd1 (diff)
downloadFreeBSD-src-521f052069e7f7eac849e9e05677ed76a764f2ad.zip
FreeBSD-src-521f052069e7f7eac849e9e05677ed76a764f2ad.tar.gz
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.
Diffstat (limited to 'bin/mkdir/mkdir.c')
-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 17e7ccf..5f86588 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;
OpenPOWER on IntegriCloud