mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* malloc/thread-freeres.c: Conditionalize on _LIBC_REENTRANT.
* sunrpc/rpc_thread.c: Likewise for text_set_element use. (__rpc_thread_destroy): Add it to __libc_subfreeres too. * include/resolv.h: Add libc_hidden_proto for __res_nclose. * resolv/res_init.c (__res_nclose): Add libc_hidden_def. (res_thread_freeres): New function, on __libc_thread_subfreeres and __libc_subfreeres. * malloc/Versions (libc: GLIBC_PRIVATE): Add __libc_thread_freeres. * sunrpc/Versions (libc: GLIBC_PRIVATE): Removed.
This commit is contained in:
13
ChangeLog
13
ChangeLog
@ -1,9 +1,18 @@
|
|||||||
2003-02-21 Roland McGrath <roland@redhat.com>
|
2003-02-21 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* malloc/Versions (GLIBC_PRIVATE): Add __libc_thread_freeres.
|
* malloc/thread-freeres.c: Conditionalize on _LIBC_REENTRANT.
|
||||||
|
* sunrpc/rpc_thread.c: Likewise for text_set_element use.
|
||||||
|
(__rpc_thread_destroy): Add it to __libc_subfreeres too.
|
||||||
|
|
||||||
|
* include/resolv.h: Add libc_hidden_proto for __res_nclose.
|
||||||
|
* resolv/res_init.c (__res_nclose): Add libc_hidden_def.
|
||||||
|
(res_thread_freeres): New function, on __libc_thread_subfreeres and
|
||||||
|
__libc_subfreeres.
|
||||||
|
|
||||||
|
* malloc/Versions (libc: GLIBC_PRIVATE): Add __libc_thread_freeres.
|
||||||
* malloc/thread-freeres.c: New file.
|
* malloc/thread-freeres.c: New file.
|
||||||
* malloc/Makefile (aux): Add it.
|
* malloc/Makefile (aux): Add it.
|
||||||
* sunrpc/Versions (GLIBC_PRIVATE): Removed.
|
* sunrpc/Versions (libc: GLIBC_PRIVATE): Removed.
|
||||||
* sunrpc/rpc_thread.c (__rpc_thread_destroy): Put in special section
|
* sunrpc/rpc_thread.c (__rpc_thread_destroy): Put in special section
|
||||||
"__libc_thread_freeres_fn" and add to __libc_thread_subfreeres set.
|
"__libc_thread_freeres_fn" and add to __libc_thread_subfreeres set.
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ extern void res_send_setrhook (res_send_rhook __hook);
|
|||||||
extern int res_ourserver_p (const res_state __statp,
|
extern int res_ourserver_p (const res_state __statp,
|
||||||
const struct sockaddr_in6 *__inp);
|
const struct sockaddr_in6 *__inp);
|
||||||
libc_hidden_proto (__res_ninit)
|
libc_hidden_proto (__res_ninit)
|
||||||
|
libc_hidden_proto (__res_nclose)
|
||||||
libc_hidden_proto (__res_randomid)
|
libc_hidden_proto (__res_randomid)
|
||||||
libc_hidden_proto (__res_state)
|
libc_hidden_proto (__res_state)
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <libc-internal.h>
|
#include <libc-internal.h>
|
||||||
#include <set-hooks.h>
|
#include <set-hooks.h>
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
DEFINE_HOOK (__libc_thread_subfreeres, (void));
|
DEFINE_HOOK (__libc_thread_subfreeres, (void));
|
||||||
|
|
||||||
void __attribute__ ((section ("__libc_thread_freeres_fn")))
|
void __attribute__ ((section ("__libc_thread_freeres_fn")))
|
||||||
@ -28,3 +29,4 @@ __libc_thread_freeres (void)
|
|||||||
{
|
{
|
||||||
RUN_HOOK (__libc_thread_subfreeres, ());
|
RUN_HOOK (__libc_thread_subfreeres, ());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -528,6 +528,7 @@ res_randomid(void) {
|
|||||||
libc_hidden_def (__res_randomid)
|
libc_hidden_def (__res_randomid)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This routine is for closing the socket if a virtual circuit is used and
|
* This routine is for closing the socket if a virtual circuit is used and
|
||||||
* the program wants to close it. This provides support for endhostent()
|
* the program wants to close it. This provides support for endhostent()
|
||||||
@ -556,3 +557,26 @@ res_nclose(res_state statp) {
|
|||||||
}
|
}
|
||||||
statp->_u._ext.nsinit = 0;
|
statp->_u._ext.nsinit = 0;
|
||||||
}
|
}
|
||||||
|
#ifdef _LIBC
|
||||||
|
libc_hidden_def (__res_nclose)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
# ifdef _LIBC_REENTRANT
|
||||||
|
/* This is called when a thread is exiting to free resources held in _res. */
|
||||||
|
static void __attribute__ ((section ("__libc_thread_freeres_fn")))
|
||||||
|
res_thread_freeres (void)
|
||||||
|
{
|
||||||
|
__res_nclose (&_res); /* Close any VC sockets. */
|
||||||
|
|
||||||
|
for (int ns = 0; ns < MAXNS; ns++)
|
||||||
|
if (_res._u._ext.nsaddrs[ns] != NULL)
|
||||||
|
{
|
||||||
|
free (_res._u._ext.nsaddrs[ns]);
|
||||||
|
_res._u._ext.nsaddrs[ns] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
text_set_element (__libc_thread_subfreeres, res_thread_freeres);
|
||||||
|
text_set_element (__libc_subfreeres, res_thread_freeres);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
@ -30,9 +30,13 @@ __rpc_thread_destroy (void)
|
|||||||
free (tvp->authdes_cache_s);
|
free (tvp->authdes_cache_s);
|
||||||
free (tvp->authdes_lru_s);
|
free (tvp->authdes_lru_s);
|
||||||
free (tvp);
|
free (tvp);
|
||||||
|
__libc_tsd_set (RPC_VARS, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
text_set_element (__libc_thread_subfreeres, __rpc_thread_destroy);
|
text_set_element (__libc_thread_subfreeres, __rpc_thread_destroy);
|
||||||
|
#endif
|
||||||
|
text_set_element (__libc_subfreeres, __rpc_thread_destroy);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user