don't use sys_nerr with Solaris/64 Bit

since it isn't available then
This commit is contained in:
Georg Sauthoff 2016-08-26 23:48:40 +02:00
parent 3c18899ecb
commit 1755c69296
2 changed files with 10 additions and 1 deletions

View file

@ -364,7 +364,9 @@ setup_char_semantics(void)
char *
errmsg(int errnum)
{
#if defined(_LP64)
return strerror(errnum);
#else
extern int sys_nerr;
char *errbuf;
@ -376,6 +378,7 @@ errmsg(int errnum)
return strerror(errnum);
}
#endif
}
static char static_buf[MAXPATHLEN*3];

View file

@ -37,9 +37,11 @@
#include <libintl.h>
#ifdef __sun
#if !defined(_LP64)
extern char *sys_errlist[];
extern int sys_nerr;
#endif
#endif
static void file_lock_error(char *msg, char *file, char *str, const char *arg1, const char *arg2);
@ -167,11 +169,15 @@ file_lock_error(char *msg, char *file, char *str, const char *arg1, const char *
len = strlen(msg);
sprintf(&msg[len], str, arg1, arg2);
strcat(msg, gettext(" failed - "));
#if defined(_LP64)
strcat(msg, strerror(errno));
#else
if (errno < sys_nerr) {
strcat(msg, strerror(errno));
} else {
len = strlen(msg);
sprintf(&msg[len], "errno %d", errno);
}
#endif
}