[git commit master 1/1] linuxthreads: Fix compilation breakage

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Dec 23 09:48:28 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=2a416f277e43be8301f1fdcdca7515b1e2a4508c
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

With commit "resolv.c: add support for per thread res_state"
(aab4df0fb51660300559f5f29290709db2f7bfee) _res symbol is now marked
as hidden in an attempt to make the resolver per-thread.

Signed-off-by: Matt Fleming <matthew.fleming at imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libpthread/linuxthreads/pthread.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 614cad1..db43634 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -49,7 +49,7 @@ extern int _h_errno;
 /* We need the global/static resolver state here.  */
 # include <resolv.h>
 # undef _res
-extern struct __res_state _res;
+extern struct __res_state *__resp;
 # endif
 #endif
 
@@ -73,9 +73,6 @@ struct _pthread_descr_struct __pthread_initial_thread = {
 #if !(USE_TLS && HAVE___THREAD)
   .p_errnop = &_errno,
   .p_h_errnop = &_h_errno,
-# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
-  .p_resp = &_res,
-# endif
 #endif
   .p_userstack = 1,
   .p_resume_count = __ATOMIC_INITIALIZER,
@@ -544,14 +541,14 @@ static void pthread_initialize(void)
   THREAD_SETMEM (((pthread_descr) NULL), p_pid, __getpid());
 # if !defined HAVE___THREAD && (defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__)
   /* Likewise for the resolver state _res.  */
-  THREAD_SETMEM (((pthread_descr) NULL), p_resp, &_res);
+  THREAD_SETMEM (((pthread_descr) NULL), p_resp, __resp);
 # endif
 #else
   /* Update the descriptor for the initial thread. */
   __pthread_initial_thread.p_pid = __getpid();
 # if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
   /* Likewise for the resolver state _res.  */
-  __pthread_initial_thread.p_resp = &_res;
+  __pthread_initial_thread.p_resp = __resp;
 # endif
 #endif
 #if !__ASSUME_REALTIME_SIGNALS
@@ -1129,7 +1126,7 @@ void __pthread_reset_main_thread(void)
   THREAD_SETMEM(self, p_errnop, &_errno);
   THREAD_SETMEM(self, p_h_errnop, &_h_errno);
 # if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
-  THREAD_SETMEM(self, p_resp, &_res);
+  THREAD_SETMEM(self, p_resp, __resp);
 # endif
 #endif
 
-- 
1.7.2.2



More information about the uClibc-cvs mailing list