From 8342b063de33a75574831c29260e31db436cc7cb Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 27 Feb 2006 01:21:07 +0000 Subject: [PATCH] un-static-ize sigar_gethostbyname --- include/sigar_util.h | 2 ++ src/sigar.c | 2 +- src/sigar_util.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/sigar_util.h b/include/sigar_util.h index 206ee061..8f38fa31 100644 --- a/include/sigar_util.h +++ b/include/sigar_util.h @@ -30,6 +30,8 @@ char *sigar_uitoa(char *buf, unsigned int n, int *len); +struct hostent *sigar_gethostbyname(const char *name); + SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen); SIGAR_INLINE char *sigar_skip_token(char *p); diff --git a/src/sigar.c b/src/sigar.c index de98c358..a5719710 100644 --- a/src/sigar.c +++ b/src/sigar.c @@ -1557,7 +1557,7 @@ static int fqdn_ip_get(sigar_t *sigar, char *name) #define HAS_HOSTENT_DATA #endif -static struct hostent *sigar_gethostbyname(const char *name) +struct hostent *sigar_gethostbyname(const char *name) { char buffer[GETHOSTBYNAME_LEN]; struct hostent hs, *hp; diff --git a/src/sigar_util.c b/src/sigar_util.c index 5c0341b1..60431346 100644 --- a/src/sigar_util.c +++ b/src/sigar_util.c @@ -501,7 +501,7 @@ static int get_sockaddr(struct sockaddr_in *addr, char *host) addr->sin_family = AF_INET; if ((addr->sin_addr.s_addr = inet_addr(host)) == -1) { - if (!(hp = gethostbyname(host))) { + if (!(hp = sigar_gethostbyname(host))) { return -1; } memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);