Fix for uclibc

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-04-15 00:13:30 +00:00
parent 97dd838cda
commit de51a91db3

9
dns.c
View File

@@ -162,12 +162,17 @@ int ast_search_dns(void *context,
int res, ret = -1; int res, ret = -1;
#ifdef linux #ifdef linux
#ifndef __UCLIBC__
res_ninit(&dnsstate); res_ninit(&dnsstate);
res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer)); res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
#else #else
res_init(); res_init();
res = res_search(dname, class, type, answer, sizeof(answer)); res = res_search(dname, class, type, answer, sizeof(answer));
#endif #endif
#else
res_init();
res = res_search(dname, class, type, answer, sizeof(answer));
#endif
if (res > 0) { if (res > 0) {
if ((res = dns_parse_answer(context, class, type, answer, res, callback)) < 0) { if ((res = dns_parse_answer(context, class, type, answer, res, callback)) < 0) {
ast_log(LOG_WARNING, "Parse error\n"); ast_log(LOG_WARNING, "Parse error\n");
@@ -181,7 +186,11 @@ int ast_search_dns(void *context,
ret = 1; ret = 1;
} }
#if defined(linux) #if defined(linux)
#ifndef __UCLIBC__
res_nclose(&dnsstate); res_nclose(&dnsstate);
#else
res_close();
#endif
#else #else
#ifndef __APPLE__ #ifndef __APPLE__
res_close(); res_close();