libbb: conditionalize AF_* usage in error reporting
authorJeremie Koenig <jk@jk.fr.eu.org>
Thu, 27 May 2010 13:39:24 +0000 (15:39 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 18 Jul 2010 22:46:47 +0000 (00:46 +0200)
Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/xfuncs_printf.c
networking/Config.src

index 7069a7c8e949e20a7745a35eb46c5193f708b28e..91f7ba22cff8b2522934e31ce14e436f75a5713c 100644 (file)
@@ -387,8 +387,12 @@ int FAST_FUNC xsocket(int domain, int type, int protocol)
                /* Hijack vaguely related config option */
 #if ENABLE_VERBOSE_RESOLUTION_ERRORS
                const char *s = "INET";
+# ifdef AF_PACKET
                if (domain == AF_PACKET) s = "PACKET";
+# endif
+# ifdef AF_NETLINK
                if (domain == AF_NETLINK) s = "NETLINK";
+# endif
 IF_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
                bb_perror_msg_and_die("socket(AF_%s,%d,%d)", s, type, protocol);
 #else
index 26c59e7c1cb8388d53be94910743c784e0d9516b..fc613e8d3885a88dd76ab1f27edab361e9bf8a96 100644 (file)
@@ -43,7 +43,6 @@ config FEATURE_PREFER_IPV4_ADDRESS
 config VERBOSE_RESOLUTION_ERRORS
        bool "Verbose resolution errors"
        default n
-       depends on PLATFORM_LINUX #because of xsocket() in libbb/xfuncs_prinf.c
        help
          Enable if you are not satisfied with simplistic
          "can't resolve 'hostname.com'" and want to know more.