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