bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] Handle alternative getnameinfo() prototype


From: Petter Reinholdtsen
Subject: [patch] Handle alternative getnameinfo() prototype
Date: Mon, 18 Sep 2006 18:32:17 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (usg-unix-v)

To get coreutils 6.1 to build on Tru64 Unix, in addition to the minor
typo reported earlier, I had to change the prototype used for
getnameinfo() to match the on in /usr/include/netdb.h.  This ugly
patch solved the issue:


diff -ur src-6.1/lib/getaddrinfo.c src-6.1-local/lib/getaddrinfo.c
--- src-6.1/lib/getaddrinfo.c   2006-08-10 09:17:38.000000000 +0200
+++ src-6.1-local/lib/getaddrinfo.c     2006-09-18 18:28:00.000000000 +0200
@@ -322,10 +322,17 @@
     }
 }
 
+#ifdef __alpha
+int getnameinfo(const struct sockaddr *restrict sa, size_t salen,
+               char *restrict node, size_t nodelen,
+               char *restrict service, size_t servicelen,
+               int flags)
+#else
 int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
                char *restrict node, socklen_t nodelen,
                char *restrict service, socklen_t servicelen,
                int flags)
+#endif
 {
 #ifdef WIN32_NATIVE
   if (use_win32_p ())

The problem was that the selected prototype used size_t instead of
socklen_t for salen, nodelen and servicelen.  An alternative prototype
in the header (not used in this build) used socklen for salen, and
size_t for nodelen and servicelen.

Anyway, with these patches applied, I got coreutil 6.1 building on
Tru64 Unix. :)

Friendly,
-- 
Petter Reinholdtsen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]