If GETHOSTBYADDRRSTYLE isn't defined, then don't compare it to
authoraland <aland>
Wed, 13 Mar 2002 16:48:39 +0000 (16:48 +0000)
committeraland <aland>
Wed, 13 Mar 2002 16:48:39 +0000 (16:48 +0000)
anything.

src/lib/misc.c

index 8bb33ab..8d48235 100644 (file)
@@ -50,6 +50,7 @@ char * ip_hostname(char *buf, size_t buflen, uint32_t ipaddr)
                return buf;
        }
 
+#ifdef GETHOSTBYADDRRSTYLE
 #if GETHOSTBYADDRRSTYLE == SYSVSTYLE
        hp = gethostbyaddr_r((char *)&ipaddr, sizeof(struct in_addr), AF_INET, &result, buffer, sizeof(buffer), &error);
 #elif GETHOSTBYADDRRSTYLE == GNUSTYLE
@@ -57,6 +58,9 @@ char * ip_hostname(char *buf, size_t buflen, uint32_t ipaddr)
 #else
        hp = gethostbyaddr((char *)&ipaddr, sizeof(struct in_addr), AF_INET);
 #endif
+#else
+       hp = gethostbyaddr((char *)&ipaddr, sizeof(struct in_addr), AF_INET);
+#endif
        if ((hp == NULL) ||
            (strlen((char *)hp->h_name) >= buflen)) {
                ip_ntoa(buf, ipaddr);