summaryrefslogtreecommitdiff
path: root/src/getnetconfig.c
diff options
context:
space:
mode:
authorIan Kent <ikent@redhat.com>2009-04-20 09:50:57 -0400
committerSteve Dickson <steved@redhat.com>2009-04-20 09:50:57 -0400
commit3897d3fd71f58df9dd5b3543e85d901c1eac6fd4 (patch)
tree181ba5be73efd1a89906912b8ee4cf2a0865cee8 /src/getnetconfig.c
parentad150b37206b3376416d49e36ebda116456f226c (diff)
downloadti-rpc-3897d3fd71f58df9dd5b3543e85d901c1eac6fd4.tar.gz
libtirpc-0.1.10 - tsd destory at unload
If tsd keys are created that use a function local to the library and are not destroyed at library unload this can lead to a SEGV if the library is unloaded before the last thread is unloaded. Also, calling free() on an address previously belonging to the now unloaded library might not be very good either. I'm not to clear about what happens to data areas used by shared libraries in terms of their presence or otherwise in the lifcycle of a shared library. This patch assumes that all threads using the library have exited prior to the library being unloaded but may be worth more thought. Signed-off-by: Ian Kent <ikent@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'src/getnetconfig.c')
-rw-r--r--src/getnetconfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/getnetconfig.c b/src/getnetconfig.c
index 9e26afb..b7ea0a9 100644
--- a/src/getnetconfig.c
+++ b/src/getnetconfig.c
@@ -129,7 +129,7 @@ static int *
__nc_error()
{
static pthread_mutex_t nc_lock = PTHREAD_MUTEX_INITIALIZER;
- static thread_key_t nc_key = -1;
+ extern thread_key_t nc_key;
static int nc_error = 0;
int error, *nc_addr;