un-static-ize sigar_gethostbyname

This commit is contained in:
Doug MacEachern 2006-02-27 01:21:07 +00:00
parent 4bd1621076
commit 8342b063de
3 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);