summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ChangeLog2
-rw-r--r--src/include/fake-addrinfo.h11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/include/ChangeLog b/src/include/ChangeLog
index 0872f7104..ba1fbf6f1 100644
--- a/src/include/ChangeLog
+++ b/src/include/ChangeLog
@@ -1,5 +1,7 @@
2002-06-04 Ken Raeburn <raeburn@mit.edu>
+ * fake-addrinfo.h [COPY_FIRST_CANONNAME]: Include string.h.
+
* k5-int.h (struct addrlist): Field "addrs" now points to
addrinfo instead of sockaddr.
diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h
index 9173bf5ad..5003becd2 100644
--- a/src/include/fake-addrinfo.h
+++ b/src/include/fake-addrinfo.h
@@ -119,6 +119,14 @@ gai_strerror (int code) /*@*/;
/* # define WRAP_GETNAMEINFO */
#endif
+#ifdef __linux__
+# define COPY_FIRST_CANONNAME
+#endif
+
+#ifdef COPY_FIRST_CANONNAME
+# include <string.h>
+#endif
+
#ifdef _WIN32
#define HAVE_GETADDRINFO
#define HAVE_GETNAMEINFO
@@ -765,7 +773,6 @@ getaddrinfo (const char *name, const char *serv, const struct addrinfo *hint,
if (aierr || *result == 0)
return aierr;
-#ifdef __linux__
/* Linux libc version 6 (libc-2.2.4.so on Debian) is broken.
RFC 2553 says that when AI_CANONNAME is set, the ai_canonname
@@ -797,7 +804,7 @@ getaddrinfo (const char *name, const char *serv, const struct addrinfo *hint,
for at configure time. Always do it on Linux for now. When
they get around to fixing it, add a compile-time or run-time
check for the glibc version in use. */
-#define COPY_FIRST_CANONNAME
+#ifdef COPY_FIRST_CANONNAME
if (/* name && hint && (hint->ai_flags & AI_CANONNAME) */ (*result)->ai_canonname) {
struct hostent *hp;
const char *name2 = 0;