subfmt(context, &buf, "{hexlenstr}", d->length, d->data);
} else if (strcmp(tmpbuf, "errno") == 0) {
err = va_arg(ap, int);
- p = NULL;
-#ifdef HAVE_STRERROR_R
+ k5_buf_add_fmt(&buf, "%d", err);
if (strerror_r(err, tmpbuf, sizeof(tmpbuf)) == 0)
- p = tmpbuf;
-#endif
- if (p == NULL)
- p = strerror(err);
- k5_buf_add_fmt(&buf, "%d/%s", err, p);
+ k5_buf_add_fmt(&buf, "/%s", tmpbuf);
} else if (strcmp(tmpbuf, "kerr") == 0) {
kerr = va_arg(ap, krb5_error_code);
p = krb5_get_error_message(context, kerr);
if (ldap_context->service_password_file)
file = ldap_context->service_password_file;
-#ifndef HAVE_STRERROR_R
-# undef strerror_r
-# define strerror_r(ERRNUM, BUF, SIZE) (strncpy(BUF, strerror(ERRNUM), SIZE), BUF[(SIZE)-1] = 0)
-#endif
-
fptr = fopen(file, "r");
if (fptr == NULL) {
st = errno;
#include "error_table.h"
#include "k5-platform.h"
-#if !defined(HAVE_STRERROR) && !defined(SYS_ERRLIST_DECLARED)
-extern char const * const sys_errlist[];
-extern const int sys_nerr;
-#endif
-
static struct et_list *et_list;
static k5_mutex_t et_list_lock = K5_MUTEX_PARTIAL_INITIALIZER;
static int terminated = 0; /* for debugging shlib fini sequence errors */
/* This could trip if int is 16 bits. */
if ((unsigned long)(int)code != (unsigned long)code)
abort ();
-#ifdef HAVE_STRERROR_R
cp = get_thread_buffer();
- if (cp && strerror_r((int) code, cp, ET_EBUFSIZ) == 0)
+ if (cp && strerror_r(code, cp, ET_EBUFSIZ) == 0)
return cp;
-#endif
-#ifdef HAVE_STRERROR
- cp = strerror((int) code);
- if (cp)
- return cp;
-#elif defined HAVE_SYS_ERRLIST
- if (offset < sys_nerr)
- return(sys_errlist[offset]);
-#endif
- goto oops;
+ return strerror(code);
}
k5_mutex_lock(&et_list_lock);
lock();
if (fptr == NULL) {
unlock();
-#ifdef HAVE_STRERROR_R
if (strerror_r(code, buf, sizeof(buf)) == 0)
return oom_check(strdup(buf));
-#endif
return oom_check(strdup(strerror(code)));
}
r = fptr(code);
#endif
#endif
-
-#ifdef HAVE_STRERROR_R
-#define ERRSTR(ERR, BUF) \
- (strerror_r (ERR, BUF, sizeof(BUF)) == 0 ? BUF : strerror (ERR))
-#else
-#define ERRSTR(ERR, BUF) \
- (strerror (ERR))
-#endif
-
static long
krb5int_plugin_file_handle_array_init (struct plugin_file_handle ***harray)
{