diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-19 10:57:29 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-19 10:57:29 -0800 |
commit | 6f04a0f4c72acff80dad04828cb69ef67fa609d1 (patch) | |
tree | 915db7d93cb742f72b5d3819e69f48cb29c40a15 /libc/netbsd/resolv/res_state.c | |
parent | 2489551343aa89fc539f369f7689c941b78c08d1 (diff) | |
download | bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.zip bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.gz bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.bz2 |
auto import from //branches/cupcake/...@132276
Diffstat (limited to 'libc/netbsd/resolv/res_state.c')
-rw-r--r-- | libc/netbsd/resolv/res_state.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libc/netbsd/resolv/res_state.c b/libc/netbsd/resolv/res_state.c index 8f2851a..3a2301d 100644 --- a/libc/netbsd/resolv/res_state.c +++ b/libc/netbsd/resolv/res_state.c @@ -46,7 +46,6 @@ typedef struct { struct __res_state _nres[1]; unsigned _serial; struct prop_info* _pi; - struct hostent* _hostent; struct res_static _rstatic[1]; } _res_thread; @@ -66,9 +65,9 @@ _res_thread_alloc(void) if ( res_ninit( rt->_nres ) < 0 ) { free(rt); rt = NULL; + } else { + memset(rt->_rstatic, 0, sizeof rt->_rstatic); } - rt->_hostent = NULL; - memset(rt->_rstatic, 0, sizeof rt->_rstatic); } return rt; } @@ -93,7 +92,6 @@ _res_thread_free( void* _rt ) _res_thread* rt = _rt; _res_static_done(rt->_rstatic); - _resolv_hostent_free(rt->_hostent); res_ndestroy(rt->_nres); free(rt); } @@ -132,6 +130,7 @@ _res_thread_get(void) rt = NULL; pthread_setspecific( _res_key, rt ); } + _resolv_cache_reset(rt->_serial); return rt; } @@ -177,14 +176,6 @@ __res_put_state(res_state res) res=res; } -struct hostent** -__get_res_cache_hostent_p(void) -{ - _res_thread* rt = _res_thread_get(); - - return rt ? &rt->_hostent : NULL; -} - res_static __res_get_static(void) { |