]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2237. [bug] libbind: res_init() was not thread aware. [RT #17123]
authorMark Andrews <marka@isc.org>
Fri, 14 Sep 2007 05:35:47 +0000 (05:35 +0000)
committerMark Andrews <marka@isc.org>
Fri, 14 Sep 2007 05:35:47 +0000 (05:35 +0000)
CHANGES
lib/bind/resolv/res_data.c

diff --git a/CHANGES b/CHANGES
index 704a339da4b3bb23baa9ed81124c43f1b436efbd..71fb6ccf25c5504e033ceb773ec5ca0a90bd090a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2237.  [bug]           libbind: res_init() was not thread aware. [RT #17123]
+
 2236.  [bug]           dnssec-signzone failed to preserve the case of
                        of wildcard owner names. [RT #17085]
 
index e3dcbf04361e014780ed227655d57e1c74cb2071..736315cc4186da63133e2da47d0cb60c0bd3517b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: res_data.c,v 1.3.18.1 2005/04/27 05:01:10 sra Exp $";
+static const char rcsid[] = "$Id: res_data.c,v 1.3.18.2 2007/09/14 05:35:47 marka Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "port_before.h"
@@ -40,7 +40,6 @@ static const char rcsid[] = "$Id: res_data.c,v 1.3.18.1 2005/04/27 05:01:10 sra
 #include <unistd.h>
 
 #include "port_after.h"
-#undef _res
 
 const char *_res_opcodes[] = {
        "QUERY",
@@ -70,6 +69,7 @@ const char *_res_sectioncodes[] = {
 };
 #endif
 
+#undef _res
 #ifndef __BIND_NOSTATIC
 struct __res_state _res
 # if defined(__BIND_RES_TEXT)
@@ -77,6 +77,10 @@ struct __res_state _res
 # endif
         ;
 
+#if defined(DO_PTHREADS) || defined(__linux)
+#define _res (*__res_state())
+#endif
+
 /* Proto. */
 
 int  res_ourserver_p(const res_state, const struct sockaddr_in *);