diff --git a/acinclude.m4 b/acinclude.m4 index 903dd979e4..170c6f6021 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -798,7 +798,7 @@ fi AC_SUBST(HAVE_PAM) AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec) -AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf) +AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror) AC_CHECK_TYPE(ssize_t, int) AC_SIZEOF_TYPE(long) diff --git a/src/pinstall/install.c b/src/pinstall/install.c index bcd8bebd82..d7fc61be9a 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -91,15 +91,20 @@ RCSID static struct stat istat, ostat; static int stripcalled = 0; -#if !defined(AFS_DARWIN60_ENV) && !defined(AFS_FBSD50_ENV) +/* How many systems don't have strerror now? */ +#ifndef HAVE_STRERROR +#if !defined(AFS_DARWIN60_ENV) && !defined(AFS_FBSD50_ENV) extern int sys_nerr; #endif #if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) extern char *sys_errlist[]; #endif +char *ErrorString(int aerrno); +#else +#define ErrorString strerror +#endif /* static prototypes */ -char *ErrorString(int aerrno); int stripName(char *aname); int atoo(register char *astr); @@ -132,6 +137,7 @@ strrpbrk(char *s, char *set) return 0; } +#ifndef HAVE_STRERROR char * ErrorString(int aerrno) { @@ -143,6 +149,7 @@ ErrorString(int aerrno) } return tbuffer; } +#endif int stripName(char *aname)