+2001-03-07 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Check for strerror.
+ * clnt_perror.c (strerror, sys_nerr) [!HAVE_STRERROR]: Define.
+ (sys_nerr) [HAVE_STRERROR]: Declare at top level instead of in
+ clnt_spcreateerror.
+ (clnt_sperror, clnt_spcreateerror): Use strerror always.
+
Sun Feb 18 17:48:35 2001 Ezra Peisach <epeisach@kangaroo.mit.edu>
* xdr.h: Flush out prototypes for xdrmem_create(),
#include <gssrpc/auth.h>
#include <gssrpc/clnt.h>
+#ifndef HAVE_STRERROR
#ifdef NEED_SYS_ERRLIST
extern char *sys_errlist[];
#endif
+#undef sys_nerr
+#define sys_nerr 99999 /* XXX */
+#undef strerror
+#define strerror(N) sys_errlist[N]
+#else
+extern int sys_nerr;
+#endif /* HAVE_STRERROR */
static char *auth_errmsg();
case RPC_CANTSEND:
case RPC_CANTRECV:
/* 10 for the string */
- if(str - bufstart + 10 + strlen(sys_errlist[e.re_errno]) < BUFSIZ)
+ if(str - bufstart + 10 + strlen(strerror(e.re_errno)) < BUFSIZ)
(void) sprintf(str, "; errno = %s",
- sys_errlist[e.re_errno]);
+ strerror(e.re_errno));
str += strlen(str);
break;
clnt_spcreateerror(s)
char *s;
{
- extern int sys_nerr;
char *str = _buf();
if (str == 0)
if (rpc_createerr.cf_error.re_errno > 0
&& rpc_createerr.cf_error.re_errno < sys_nerr)
(void) strncat(str,
- sys_errlist[rpc_createerr.cf_error.re_errno],
+ strerror(rpc_createerr.cf_error.re_errno),
BUFSIZ - 1 - strlen(str));
else
(void) sprintf(&str[strlen(str)], "Error %d",
SIZEOF_LONG=$ac_cv_sizeof_long
AC_SUBST(SIZEOF_LONG)
+AC_CHECK_FUNCS(strerror)
+
AC_MSG_CHECKING([return type of setrpcent])
AC_CACHE_VAL(k5_cv_type_setrpcent,
[AC_TRY_COMPILE([#include <netdb.h>