X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmakepath.c;h=e61579021c204d7a613dae11b92091610003131c;hb=ff9a646b84f2efe592f16cab668ea5538171bc83;hp=98b78a1e658e69d7aa5b91107b69af45838ffe7a;hpb=26e411da187cbe2e67d334a9230f4836219c24e2;p=gnulib.git diff --git a/lib/makepath.c b/lib/makepath.c index 98b78a1e6..e61579021 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -43,15 +43,22 @@ char *alloca (); #endif #ifdef STDC_HEADERS -#include #include -#else +#endif + +#ifdef HAVE_ERRNO_H +#include +#endif + +#ifndef STDC_HEADERS extern int errno; #endif -#if defined(USG) || defined(STDC_HEADERS) +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include +#ifndef index #define index strchr +#endif #else #include #endif @@ -93,7 +100,7 @@ make_path (argpath, mode, parent_mode, owner, group, verbose_fmt_string) int retval = 0; int oldmask = umask (0); - dirpath = alloca (strlen (argpath) + 1); + dirpath = (char *) alloca (strlen (argpath) + 1); strcpy (dirpath, argpath); if (stat (dirpath, &stats)) @@ -145,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 )