diff options
author | Richard Braun <rbraun@sceen.net> | 2014-02-19 21:30:22 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-02-19 21:30:22 +0100 |
commit | 3b391db91f70b2166951413ee1eccc78cd398a44 (patch) | |
tree | 59bf0503bac417c29e4a3a8db699b46180a5ae6d /pthread/pt-alloc.c | |
parent | 7c6dc6e28b2fc4b67934223f41cf080ffe58b230 (diff) |
Make name resolution thread-safe
* pthread/pt-alloc.c (initialize_pthread): Reset resolver state.
* pthread/pt-create.c: Include <resolv.h>.
(entry_point): Update the __resp TLS variable to point to the resolver
state of the current thread.
* pthread/pt-internal.h: Define __need_res_state and include <resolv.h>.
(struct __pthread): New `res_state' member.
Diffstat (limited to 'pthread/pt-alloc.c')
-rw-r--r-- | pthread/pt-alloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pthread/pt-alloc.c b/pthread/pt-alloc.c index af544c5..4860f48 100644 --- a/pthread/pt-alloc.c +++ b/pthread/pt-alloc.c @@ -68,6 +68,8 @@ initialize_pthread (struct __pthread *new) new->cancelation_handlers = 0; + memset (&new->res_state, '\0', sizeof (new->res_state)); + #ifdef ENABLE_TLS new->tcb = NULL; #endif |