From 04a7ed77c215318884d3e2de1d08a1d0f55a8b6e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 3 Aug 2002 05:47:52 +0000 Subject: [PATCH] Declare _errno, _h_errno, and _res unless we use TLS internally. --- linuxthreads/pthread.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 3c978a5bc0..8110317736 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -38,6 +38,18 @@ # error "This must not happen; new kernel assumed but old headers" #endif +#if !(USE_TLS && HAVE___THREAD) +/* These variables are used by the setup code. */ +extern int _errno; +extern int _h_errno; + +/* We need the global/static resolver state here. */ +# include +# undef _res +#endif + +extern struct __res_state _res; + #ifdef USE_TLS /* We need only a few variables. */ @@ -45,16 +57,6 @@ static pthread_descr manager_thread; #else -/* These variables are used by the setup code. */ -extern int _errno; -extern int _h_errno; - -/* We need the global/static resolver state here. */ -#include -#undef _res - -extern struct __res_state _res; - /* Descriptor of the initial thread */ struct _pthread_descr_struct __pthread_initial_thread = {