summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-22 05:42:26 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-22 05:42:26 +0000
commit0adb008b03d39a3e288944b79c337cf39ad768b2 (patch)
tree53e21b9b42edbe47a2882d8411afa9ee031939bb
parent08c07f2a1c7edd920d5e21112907fd3c8d8604fe (diff)
downloadcoreutils-0adb008b03d39a3e288944b79c337cf39ad768b2.tar.xz
(ENOSYS): Define to EEXIST if not defined.
(make_dir_parents): Treat ENOSYS like EEXIST.
-rw-r--r--lib/mkdir-p.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c
index 315a3a06a..b074c0aa7 100644
--- a/lib/mkdir-p.c
+++ b/lib/mkdir-p.c
@@ -19,7 +19,7 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -45,6 +45,10 @@
#include "quote.h"
#include "stat-macros.h"
+#ifndef ENOSYS
+# define ENOSYS EEXIST
+#endif
+
#define WX_USR (S_IWUSR | S_IXUSR)
/* Ensure that the directory ARG exists.
@@ -211,10 +215,14 @@ make_dir_parents (char const *arg,
leading_dirs = new;
}
}
- else if (errno == EEXIST)
+ else if (errno == EEXIST || errno == ENOSYS)
{
/* A file is already there. Perhaps it is a directory.
- If not, it will be diagnosed later. */
+ If not, it will be diagnosed later.
+
+ The ENOSYS is for Solaris 8 NFS clients, which can
+ fail with errno == ENOSYS if mkdir is invoked on an
+ NFS mount point. */
}
else
{