diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-14 23:36:30 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-14 23:36:30 +0000 |
commit | 70cedacdde512d2ed5984eec242c55f3239b73fc (patch) | |
tree | 48694f38698e4ead3840305333816193c7fcd8a0 /utils.c | |
parent | c60f8a2b8e1551244e674baff85cb1a4f2d5fd5b (diff) |
Merge slimey's Solaris compatibility (with small mods) (bug #2740)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4446 f38db490-d61c-443f-a65b-d21fe96a405b
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; } |