Fix for uclibc
authorMark Spencer <markster@digium.com>
Thu, 15 Apr 2004 00:13:30 +0000 (00:13 +0000)
committerMark Spencer <markster@digium.com>
Thu, 15 Apr 2004 00:13:30 +0000 (00:13 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2693 65c4cc65-6c06-0410-ace0-fbb531ad65f3

dns.c

diff --git a/dns.c b/dns.c
index 7da0224..c453149 100755 (executable)
--- a/dns.c
+++ b/dns.c
@@ -162,8 +162,13 @@ int ast_search_dns(void *context,
        int res, ret = -1;
 
 #ifdef linux
-       res_ninit(&dnsstate);
-       res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
+       #ifndef __UCLIBC__
+               res_ninit(&dnsstate);
+               res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
+       #else
+               res_init();
+               res = res_search(dname, class, type, answer, sizeof(answer));
+       #endif
 #else
        res_init();
        res = res_search(dname, class, type, answer, sizeof(answer));
@@ -181,7 +186,11 @@ int ast_search_dns(void *context,
                        ret = 1;
        }
 #if defined(linux)
-       res_nclose(&dnsstate);
+       #ifndef __UCLIBC__
+               res_nclose(&dnsstate);
+       #else
+               res_close();
+       #endif
 #else
 #ifndef __APPLE__
        res_close();