merge with 1.6
[gnulib.git] / lib / makepath.c
index 4c19630..e615790 100644 (file)
@@ -43,9 +43,14 @@ char *alloca ();
 #endif
 
 #ifdef STDC_HEADERS
-#include <errno.h>
 #include <stdlib.h>
-#else
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#ifndef STDC_HEADERS
 extern int errno;
 #endif
 
@@ -147,7 +152,7 @@ make_path (argpath, mode, parent_mode, owner, group, verbose_fmt_string)
 
                  if (owner != (uid_t) -1 && group != (gid_t) -1
                      && chown (dirpath, owner, group)
-#ifdef AFS
+#if defined(AFS) && defined (EPERM)
                      && errno != EPERM
 #endif
                      )