From d5d9a271ea1f1842d6ab90495d0dc048b562f1f8 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 24 Dec 2004 08:10:42 +0000 Subject: [PATCH] Use HAVE_GETHOSTBYNAME consistently (#ifdef everywhere else, would be an error if ever undefined). --- lnet/utils/portals.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lnet/utils/portals.c b/lnet/utils/portals.c index dbe264b..268e2d6 100644 --- a/lnet/utils/portals.c +++ b/lnet/utils/portals.c @@ -317,8 +317,7 @@ ptl_parse_ipaddr (__u32 *ipaddrp, char *str) struct hostent *he; #endif - if (!strcmp (str, "_all_")) - { + if (!strcmp (str, "_all_")) { *ipaddrp = 0; return (0); } @@ -326,11 +325,10 @@ ptl_parse_ipaddr (__u32 *ipaddrp, char *str) if (ptl_parse_ipquad(ipaddrp, str) == 0) return (0); -#if HAVE_GETHOSTBYNAME +#ifdef HAVE_GETHOSTBYNAME if ((('a' <= str[0] && str[0] <= 'z') || ('A' <= str[0] && str[0] <= 'Z')) && - (he = ptl_gethostbyname (str)) != NULL) - { + (he = ptl_gethostbyname (str)) != NULL) { __u32 addr = *(__u32 *)he->h_addr; *ipaddrp = ntohl(addr); /* HOST byte order */ @@ -423,7 +421,7 @@ ptl_nid2str (char *buffer, ptl_nid_t nid) if (nid & 0xff000000) { __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */ - he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET); + he = gethostbyaddr((const char *)&addr, sizeof(addr), AF_INET); } if (he != NULL) -- 1.8.3.1