diff options
author | Mark Spencer <markster@digium.com> | 2004-12-14 23:36:30 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-12-14 23:36:30 +0000 |
commit | 9d40b8ee8045660d58281553e34b7f45406951c0 (patch) | |
tree | 48694f38698e4ead3840305333816193c7fcd8a0 /utils.c | |
parent | 0f205bb07903a70272e8ae2403afe20ceb06cedc (diff) |
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
Diffstat (limited to 'utils.c')
-rwxr-xr-x | utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; } |