un-static-ize sigar_gethostbyname
This commit is contained in:
parent
4bd1621076
commit
8342b063de
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user