]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 2 Nov 2001 17:45:31 +0000 (17:45 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 2 Nov 2001 17:45:31 +0000 (17:45 +0000)
1085.   [port]          libbind: solaris: sys_nerr and sys_errlist do not
                        exist when compiling in 64 bit mode.

CHANGES
lib/bind/bsd/strerror.c
lib/bind/configure.in
lib/bind/port_after.h.in

diff --git a/CHANGES b/CHANGES
index fa52f31a5e376d8027105b5130b57cfe68d71069..b8ae158157804b148ec08395e823d9376b2d0b01 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
 
 1101.  [bug]           Array bounds read error in lwres_gai_strerror.
 
+1085.  [port]          libbind: solaris: sys_nerr and sys_errlist do not
+                       exist when compiling in 64 bit mode.
+
 1084.  [cleanup]       libbind: gai_strerror() rewritten.
 
 1083.  [bug]           The default control channel listened on the
index 975f6b34f3d73a6e5756490ab6adb527099c7678..d13adbb03b4dfcb817465826d3387473fdfabd3b 100644 (file)
@@ -1,6 +1,6 @@
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)strerror.c   8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strerror.c,v 1.3 2001/06/21 08:25:59 marka Exp $";
+static const char rcsid[] = "$Id: strerror.c,v 1.3.2.1 2001/11/02 17:45:31 gson Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -49,6 +49,11 @@ static const char rcsid[] = "$Id: strerror.c,v 1.3 2001/06/21 08:25:59 marka Exp
 int __strerror_unneeded__;
 #else
 
+#ifdef USE_SYSERROR_LIST
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif
+
 const char *
 isc_strerror(int num) {
 #define        UPREFIX "Unknown error: "
@@ -58,12 +63,17 @@ isc_strerror(int num) {
        const char *ret;
        char tmp[40];
 
+       errnum = num;                           /* convert to unsigned */
+#ifdef USE_SYSERROR_LIST
+       if (errnum < sys_nerr)
+               return (sys_errlist[errnum]);
+#else
 #undef strerror
        ret = strerror(num);                    /* call strerror() in libc */
        if (ret != NULL)
                return(ret);
-       errnum = num;                           /* convert to unsigned */
+#endif
+
        /* Do this by hand, so we don't include stdio(3). */
        t = tmp;
        do {
index b16c84a725bd4130b0bb8e8cbef5385da9c067a9..63a2b9f7c46d58cbbced638708b616c3cb858ab1 100644 (file)
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.83 $)
+AC_REVISION($Revision: 1.83.2.1 $)
 
 AC_INIT(resolv/herror.c)
 AC_PREREQ(2.13)
@@ -1265,6 +1265,10 @@ AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
 
 AC_SUBST(ISC_EXTRA_OBJS)
 AC_SUBST(ISC_EXTRA_SRCS)
+AC_CHECK_FUNC(strerror,
+       [USE_SYSERROR_LIST="#undef USE_SYSERROR_LIST"],
+       [USE_SYSERROR_LIST="#define USE_SYSERROR_LIST 1"])
+AC_SUBST(USE_SYSERROR_LIST)
 
 #
 # Determine the printf format characters to use when printing
index f396093b462c2229e449944a911a7cc1dcb3d6a5..f120779e59fb637a77baf03dcbee7b9ff8551ffc 100644 (file)
@@ -23,6 +23,7 @@
 @NEED_GETTIMEOFDAY@
 @HAVE_STRNDUP@
 @USE_FIONBIO_IOCTL@
+@USE_SYSERROR_LIST@
 
 /* XXX sunos and cygwin needs O_NDELAY */
 #define PORT_NONBLOCK O_NONBLOCK