[asterisk-commits] kpfleming: branch group/new_loader_completion r40598 - /team/group/new_loader...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Aug 19 20:52:12 MST 2006


Author: kpfleming
Date: Sat Aug 19 22:52:12 2006
New Revision: 40598

URL: http://svn.digium.com/view/asterisk?rev=40598&view=rev
Log:
HAS... HAVE... whatever :-)

Modified:
    team/group/new_loader_completion/main/dns.c

Modified: team/group/new_loader_completion/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/main/dns.c?rev=40598&r1=40597&r2=40598&view=diff
==============================================================================
--- team/group/new_loader_completion/main/dns.c (original)
+++ team/group/new_loader_completion/main/dns.c Sat Aug 19 22:52:12 2006
@@ -177,6 +177,10 @@
 	return 0;
 }
 
+#if !HAVE_RES_NINIT
+AST_MUTEX_DEFINE_STATIC(res_lock);
+#endif
+
 /*! \brief Lookup record in DNS 
 \note Asterisk DNS is synchronus at this time. This means that if your DNS does
 not work properly, Asterisk might not start properly or a channel may lock.
@@ -185,16 +189,13 @@
 	   const char *dname, int class, int type,
 	   int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer))
 {
-#ifdef HAS_RES_NINIT
+#if HAVE_RES_NINIT
 	struct __res_state dnsstate;
 #endif
 	unsigned char answer[MAX_SIZE];
 	int res, ret = -1;
 
-#ifdef HAS_RES_NINIT
-#ifdef MAKE_VALGRIND_HAPPY
-	memset(&dnsstate, 0, sizeof(dnsstate));
-#endif	
+#if HAVE_RES_NINIT
 	res_ninit(&dnsstate);
 	res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
 #else
@@ -214,7 +215,7 @@
 		else
 			ret = 1;
 	}
-#ifdef HAS_RES_NINIT
+#if HAVE_RES_NINIT
 	res_nclose(&dnsstate);
 #else
 #ifndef __APPLE__
@@ -222,5 +223,6 @@
 #endif
 	ast_mutex_unlock(&res_lock);
 #endif
+
 	return ret;
 }



More information about the asterisk-commits mailing list