aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libc/dns/resolv/res_state.c')
-rw-r--r--libc/dns/resolv/res_state.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libc/dns/resolv/res_state.c b/libc/dns/resolv/res_state.c
index 57791d1b..75bff977 100644
--- a/libc/dns/resolv/res_state.c
+++ b/libc/dns/resolv/res_state.c
@@ -50,7 +50,6 @@
50#endif 50#endif
51 51
52static pthread_key_t _res_key; 52static pthread_key_t _res_key;
53static pthread_once_t _res_once = PTHREAD_ONCE_INIT;
54 53
55typedef struct { 54typedef struct {
56 int _h_errno; 55 int _h_errno;
@@ -105,6 +104,7 @@ _res_thread_free( void* _rt )
105 free(rt); 104 free(rt);
106} 105}
107 106
107__attribute__((constructor))
108static void 108static void
109_res_init_key( void ) 109_res_init_key( void )
110{ 110{
@@ -115,7 +115,6 @@ static _res_thread*
115_res_thread_get(void) 115_res_thread_get(void)
116{ 116{
117 _res_thread* rt; 117 _res_thread* rt;
118 pthread_once( &_res_once, _res_init_key );
119 rt = pthread_getspecific( _res_key ); 118 rt = pthread_getspecific( _res_key );
120 119
121 if (rt != NULL) { 120 if (rt != NULL) {