]> andersk Git - openssh.git/commitdiff
- (dtucker) [configure.ac openbsd-compat/fake-rfc2553.c
authordtucker <dtucker>
Mon, 22 Sep 2003 02:08:23 +0000 (02:08 +0000)
committerdtucker <dtucker>
Mon, 22 Sep 2003 02:08:23 +0000 (02:08 +0000)
   openbsd-compat/fake-rfc2553.h] Bug #659: Test for and handle systems with
   where gai_strerror is defined as "const char *".  Part of patch supplied
   by bugzilla-openssh at thewrittenword.com

ChangeLog
configure.ac
openbsd-compat/fake-rfc2553.c
openbsd-compat/fake-rfc2553.h

index 6e5d8b65e3b4c6cdf116406cb1ea0ae4813996d9..5fb31e4d363d0aa5005a8147e3865229706dce67 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,10 @@
    Patch from david.haughton at ncr.com
  - (dtucker) [configure.ac] Bug #659: uid swapping issues on IRIX 6.
    Part of patch supplied by bugzilla-openssh at thewrittenword.com
+ - (dtucker) [configure.ac openbsd-compat/fake-rfc2553.c
+   openbsd-compat/fake-rfc2553.h] Bug #659: Test for and handle systems with
+   where gai_strerror is defined as "const char *".  Part of patch supplied
+   by bugzilla-openssh at thewrittenword.com
 
 20030919
  - (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL;
index c2db9be3d73d2d3692f9a3e143c6a0f057ac8140..346363ad4a457a9f15009e84704c389c63ebda02 100644 (file)
@@ -731,7 +731,7 @@ dnl    Checks for library functions. Please keep in alphabetical order
 AC_CHECK_FUNCS(\
        arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
        bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
-       gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
+       getaddrinfo getcwd getgrouplist getnameinfo getopt \
        getpeereid _getpty getrlimit getttyent glob inet_aton \
        inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
        mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
@@ -743,6 +743,21 @@ AC_CHECK_FUNCS(\
        truncate utimes vhangup vsnprintf waitpid \
 )
 
+# IRIX has a const char return value for gai_strerror()
+AC_CHECK_FUNCS(gai_strerror,[
+       AC_DEFINE(HAVE_GAI_STRERROR)
+       AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+const char *gai_strerror(int);],[
+char *str;
+
+str = gai_strerror(0);],[
+               AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
+               [Define if gai_strerror() returns const char *])])])
+
 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
 
 dnl Make sure prototypes are defined for these before using them.
index b9ac085c3a3d499112f97c551e2a1fa303b10664..a8a9dd7b3135c200795cee38b5ba9699912612db 100644 (file)
@@ -77,7 +77,11 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
 #endif /* !HAVE_GETNAMEINFO */
 
 #ifndef HAVE_GAI_STRERROR
+#ifdef HAVE_CONST_GAI_STRERROR_PROTO
+const char *
+#else
 char *
+#endif
 gai_strerror(int err)
 {
        switch (err) {
index 1ebabf998392b83f16ad732e8e313d2d1a38955c..955986b50218d3f6bd81162e22f0d6bcf5101cb6 100644 (file)
@@ -137,7 +137,7 @@ int getaddrinfo(const char *, const char *,
     const struct addrinfo *, struct addrinfo **);
 #endif /* !HAVE_GETADDRINFO */
 
-#ifndef HAVE_GAI_STRERROR
+#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
 char *gai_strerror(int);
 #endif /* !HAVE_GAI_STRERROR */
 
This page took 0.05356 seconds and 5 git commands to generate.