mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Merge slimey's Solaris compatibility (with small mods) (bug #2740)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
utils.c
7
utils.c
@@ -168,10 +168,17 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
|
||||
}
|
||||
if (!s || !*s)
|
||||
return NULL;
|
||||
#ifdef SOLARIS
|
||||
result = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &herrno);
|
||||
|
||||
if (!result || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0])
|
||||
return NULL;
|
||||
#else
|
||||
res = gethostbyname_r(host, &hp->hp, hp->buf, sizeof(hp->buf), &result, &herrno);
|
||||
|
||||
if (res || !result || !hp->hp.h_addr_list || !hp->hp.h_addr_list[0])
|
||||
return NULL;
|
||||
#endif
|
||||
return &hp->hp;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user