tar: support -T - and -X -
[oweals/busybox.git] / libbb / inet_common.c
index 3a20b4a16fb294767ac1fb5a7da9461bd6d09438..6f585ebd901a0995c8673f86787b989436c0e536 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Heavily modified by Manuel Novoa III       Mar 12, 2001
  *
- *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
@@ -23,7 +23,7 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
        s_in->sin_port = 0;
 
        /* Default is special, meaning 0.0.0.0. */
-       if (!strcmp(name, bb_str_default)) {
+       if (strcmp(name, "default") == 0) {
                s_in->sin_addr.s_addr = INADDR_ANY;
                return 1;
        }
@@ -63,9 +63,6 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
 #ifdef DEBUG
        res_init();
        _res.options |= RES_DEBUG;
-#endif
-
-#ifdef DEBUG
        bb_error_msg("gethostbyname(%s)", name);
 #endif
        hp = gethostbyname(name);
@@ -112,7 +109,7 @@ char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t ne
        if (ad == INADDR_ANY) {
                if ((numeric & 0x0FFF) == 0) {
                        if (numeric & 0x8000)
-                               return xstrdup(bb_str_default);
+                               return xstrdup("default");
                        return xstrdup("*");
                }
        }
@@ -196,7 +193,7 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
 
        if (sin6->sin6_family != AF_INET6) {
 #ifdef DEBUG
-               bb_error_msg("rresolve: unsupport address family %d!",
+               bb_error_msg("rresolve: unsupported address family %d!",
                                  sin6->sin6_family);
 #endif
                errno = EAFNOSUPPORT;
@@ -208,7 +205,7 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
        }
        if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
                if (numeric & 0x8000)
-                       return xstrdup(bb_str_default);
+                       return xstrdup("default");
                return xstrdup("*");
        }
 
@@ -221,4 +218,4 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
        return xstrdup(name);
 }
 
-#endif         /* CONFIG_FEATURE_IPV6 */
+#endif  /* CONFIG_FEATURE_IPV6 */