This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FreeBSD port (40): _sys_errlist related compilation error


FreeBSD uses the generic _strerror.c and gets a compilation error
because of the recent _sys_errlist/_sys_nerr changes. The variables
_sys_errlist/_sys_nerr are not declared in any header file (see
sysdeps/generic/bits/sys_errlist.h for the reason) but are used
when this file is compiled to a .o, for libc.a.

The fix is to use _sys_errlist_internal instead, which is properly
declared in include/stdio.h.


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.

diff -r -c3 glibc-20020828.bak/sysdeps/generic/_strerror.c glibc-20020828/sysdeps/generic/_strerror.c
*** glibc-20020828.bak/sysdeps/generic/_strerror.c	Mon Aug  5 13:24:42 2002
--- glibc-20020828/sysdeps/generic/_strerror.c	Tue Sep  3 23:55:38 2002
***************
*** 22,32 ****
  #include <sys/param.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
     the message translation.  Since <libintl.h> only defines the macro
     `dgettext' to use `dcgettext' for optimizing programs this is not
--- 22,27 ----
***************
*** 40,47 ****
  char *
  __strerror_r (int errnum, char *buf, size_t buflen)
  {
!   if (errnum < 0 || errnum >= INTUSE(_sys_nerr)
!       || INTUSE(_sys_errlist)[errnum] == NULL)
      {
        /* Buffer we use to print the number in.  For a maximum size for
  	 `int' of 8 bytes we never need more than 20 digits.  */
--- 35,42 ----
  char *
  __strerror_r (int errnum, char *buf, size_t buflen)
  {
!   if (errnum < 0 || errnum >= _sys_nerr_internal
!       || _sys_errlist_internal[errnum] == NULL)
      {
        /* Buffer we use to print the number in.  For a maximum size for
  	 `int' of 8 bytes we never need more than 20 digits.  */
***************
*** 66,72 ****
        return buf;
      }
  
!   return (char *) _(INTUSE(_sys_errlist)[errnum]);
  }
  weak_alias (__strerror_r, strerror_r)
  libc_hidden_def (__strerror_r)
--- 61,67 ----
        return buf;
      }
  
!   return (char *) _(_sys_errlist_internal[errnum]);
  }
  weak_alias (__strerror_r, strerror_r)
  libc_hidden_def (__strerror_r)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]