Adam Tkac 89803a
Written-by: Mark Andrews <Mark_Andrews isc org> (upstream)
Adam Tkac 89803a
Reviewed-by: Adam Tkac <atkac redhat com>
Adam Tkac 89803a
Adam Tkac 89803a
diff -up bind-9.5.0a6/lib/bind/resolv/res_data.c._res_errno bind-9.5.0a6/lib/bind/resolv/res_data.c
Adam Tkac 89803a
--- bind-9.5.0a6/lib/bind/resolv/res_data.c._res_errno	2007-09-06 09:26:29.000000000 +0200
Adam Tkac 89803a
+++ bind-9.5.0a6/lib/bind/resolv/res_data.c	2007-09-06 09:28:14.000000000 +0200
Adam Tkac 89803a
@@ -40,7 +40,6 @@ static const char rcsid[] = "$Id: res_da
Adam Tkac 89803a
 #include <unistd.h>
Adam Tkac 89803a
 
Adam Tkac 89803a
 #include "port_after.h"
Adam Tkac 89803a
-#undef _res
Adam Tkac 89803a
 
Adam Tkac 89803a
 const char *_res_opcodes[] = {
Adam Tkac 89803a
 	"QUERY",
Adam Tkac 89803a
@@ -70,6 +69,7 @@ const char *_res_sectioncodes[] = {
Adam Tkac 89803a
 };
Adam Tkac 89803a
 #endif
Adam Tkac 89803a
 
Adam Tkac 89803a
+#undef _res
Adam Tkac 89803a
 #ifndef __BIND_NOSTATIC
Adam Tkac 89803a
 struct __res_state _res
Adam Tkac 89803a
 # if defined(__BIND_RES_TEXT)
Adam Tkac 89803a
@@ -77,6 +77,10 @@ struct __res_state _res
Adam Tkac 89803a
 # endif
Adam Tkac 89803a
         ;
Adam Tkac 89803a
 
Adam Tkac 89803a
+#if defined(DO_PTHREADS) || defined(__linux)
Adam Tkac 89803a
+#define _res (*__res_state())
Adam Tkac 89803a
+#endif
Adam Tkac 89803a
+
Adam Tkac 89803a
 /* Proto. */
Adam Tkac 89803a
 
Adam Tkac 89803a
 int  res_ourserver_p(const res_state, const struct sockaddr_in *);