2002-09-04 Bruno Haible <bruno@clisp.org>

* sysdeps/generic/_strerror.c (_sys_errlist, _sys_nerr): Remove
	default definitions.
	(__strerror_r): Use _sys_errlist_internal instead of _sys_errlist,
	_sys_nerr_internal instead of _sys_nerr.
This commit is contained in:
Roland McGrath 2002-09-05 18:51:42 +00:00
parent a8a20be0d3
commit 43e3d6e3e2

View File

@ -22,11 +22,6 @@
#include <sys/param.h> #include <sys/param.h>
#include <stdio-common/_itoa.h> #include <stdio-common/_itoa.h>
#ifndef HAVE_GNU_LD
# define _sys_errlist sys_errlist
# define _sys_nerr sys_nerr
#endif
/* It is critical here that we always use the `dcgettext' function for /* It is critical here that we always use the `dcgettext' function for
the message translation. Since <libintl.h> only defines the macro the message translation. Since <libintl.h> only defines the macro
`dgettext' to use `dcgettext' for optimizing programs this is not `dgettext' to use `dcgettext' for optimizing programs this is not
@ -40,8 +35,8 @@
char * char *
__strerror_r (int errnum, char *buf, size_t buflen) __strerror_r (int errnum, char *buf, size_t buflen)
{ {
if (errnum < 0 || errnum >= INTUSE(_sys_nerr) if (errnum < 0 || errnum >= _sys_nerr_internal
|| INTUSE(_sys_errlist)[errnum] == NULL) || _sys_errlist_internal[errnum] == NULL)
{ {
/* Buffer we use to print the number in. For a maximum size for /* Buffer we use to print the number in. For a maximum size for
`int' of 8 bytes we never need more than 20 digits. */ `int' of 8 bytes we never need more than 20 digits. */
@ -66,7 +61,7 @@ __strerror_r (int errnum, char *buf, size_t buflen)
return buf; return buf;
} }
return (char *) _(INTUSE(_sys_errlist)[errnum]); return (char *) _(_sys_errlist_internal[errnum]);
} }
weak_alias (__strerror_r, strerror_r) weak_alias (__strerror_r, strerror_r)
libc_hidden_def (__strerror_r) libc_hidden_def (__strerror_r)