mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
use-strerror-if-available-20030725
discover and use strerror instead of sys_errlist and sys_nerr.
This commit is contained in:
parent
26891bbac0
commit
7356b6696e
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user