diff options
Diffstat (limited to 'libc/dns/resolv/res_state.c')
-rw-r--r-- | libc/dns/resolv/res_state.c | 3 |
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 | ||
52 | static pthread_key_t _res_key; | 52 | static pthread_key_t _res_key; |
53 | static pthread_once_t _res_once = PTHREAD_ONCE_INIT; | ||
54 | 53 | ||
55 | typedef struct { | 54 | typedef 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)) | ||
108 | static void | 108 | static 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) { |