owfs: remove include of rpc/netdb.h
PATCH 1/1 owfs: remove include of rpc/netdb.h
owfs carries a copy of netdb.h from an old glibc, which is only used to implement getaddrinfo on platforms that miss it (Solaris 7 in particular). Since all of our libc implementations have getaddrinfo, we don't need it.
To make the patch minimal, just include if !HAVE_GETADDRINFO.
Fixes:
http://autobuild.buildroot.net/results/d9e918c2791cd5523b2fd6478bbd4ce21e58f4f1
http://autobuild.buildroot.net/results/3a85144753e4f18491d62dccf6d5843170f8daea
--- ...t.h-only-include-compat_netdb.h-if-needed.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch
package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch new file +58 -0
@@ -0,0 +1,58 @@ +From d24e63eea4f4d234f313145e40668a5e2f64e49c Mon Sep 17 00:00:00 2001 +From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]> +Date: Wed, 9 Mar 2016 23:20:11 +0100 +Subject: [PATCH] compat.h: only include compat_netdb.h if needed + +compat_netdb.h is added for only one reason: to provide the definitions +for getaddrinfo, in case it is not provided by the system. +compat_netdb.h is just a copy from an old glibc version, but that makes +it incompatible with other standard C libraries. For example, uClibc +without RPC support doesn't have the rpc/netdb.h header. This leads to +build errors. + +To work around this, only include compat_netdb.h when needed, i.e. +when getaddrinfo isn't provided natively. + +Note that this getaddrinfo compat was introduced in commit bc54c431 to +support Solaris 7. Starting from Solaris 8, however, getaddrinfo is +available natively, and it's available on MacOS, Windows and any other +POSIX-2001 compliant system as well. So it may be worhtwhile to remove +it altogether. + +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> +--- + module/owlib/src/include/compat.h | 2 ++ + module/ownet/c/src/include/compat.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/module/owlib/src/include/compat.h b/module/owlib/src/include/compat.h +index c55bc96..e95e16f 100644 +--- a/module/owlib/src/include/compat.h ++++ b/module/owlib/src/include/compat.h +@@ -57,7 +57,9 @@ + #include <features.h> + #endif + ++#ifndef HAVE_GETADDRINFO + #include "compat_netdb.h" ++#endif + #include "compat_getopt.h" + + #ifndef HAVE_STRSEP +diff --git a/module/ownet/c/src/include/compat.h b/module/ownet/c/src/include/compat.h +index c45d852..f8ae759 100644 +--- a/module/ownet/c/src/include/compat.h ++++ b/module/ownet/c/src/include/compat.h +@@ -58,7 +58,9 @@ $Id$ + #include <features.h> + #endif + ++#ifndef HAVE_GETADDRINFO + #include "compat_netdb.h" ++#endif + #include "compat_getopt.h" + + #ifndef HAVE_STRSEP +-- +2.7.0 +
Signature · 1 line
2.7.0
Thomas Petazzoni
AppliedPATCH 1/1 owfs: remove include of rpc/netdb.h
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 11 lines · Arnout Vandecappelle (Essensium/Mind)
owfs carries a copy of
netdb.hfrom an old glibc, which is only used to implement getaddrinfo on platforms that miss it (Solaris 7 in particular). Since all of our libc implementations have getaddrinfo, we don't need it.To make the patch minimal, just include if !HAVE_GETADDRINFO.
Fixes:
http://autobuild.buildroot.net/results/d9e918c2791cd5523b2fd6478bbd4ce21e58f4f1
http://autobuild.buildroot.net/results/3a85144753e4f18491d62dccf6d5843170f8daea
Quoted 5 lines
--- ...t.h-only-include-compat_netdb.h-if-needed.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com