]> git.ipfire.org Git - thirdparty/gettext.git/commit
hostname: Use more modern network APIs.
authorBruno Haible <bruno@clisp.org>
Sat, 1 Apr 2023 15:14:43 +0000 (17:14 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 1 Apr 2023 15:14:43 +0000 (17:14 +0200)
commitc5cdf41d436261b279c172753ac727335d44b9fd
tree683471c293193efb703f178b6c41b366f3fe4a02
parent2d1963afbf456ea8ac21378a814d5230f41eeb72
hostname: Use more modern network APIs.

Reported by Jens Petersen <petersen@redhat.com>
at <https://savannah.gnu.org/bugs/?63983>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add getaddrinfo.
* gettext-tools/src/hostname.c (HAVE_GETADDRINFO): Define to 1.
Do the #includes for gethostname() after those for getaddrinfo().
(ipv4_is_linklocal, ipv6_is_linklocal): New functions.
(print_hostname): For long_format and ip_format, prefer getaddrinfo over
gethostbyname.
* gettext-tools/src/Makefile.am (hostname_LDADD): New variable.
autogen.sh
gettext-tools/src/Makefile.am
gettext-tools/src/hostname.c