diff options
author | ume <ume@FreeBSD.org> | 2006-12-15 20:49:44 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2006-12-15 20:49:44 +0000 |
commit | 89a3ca4811ee4b83778a8ddb7d54874dff19b707 (patch) | |
tree | 98ad4d99a031d8761bab0970ed88904bab483af2 /lib/libc/resolv/mtctxres.c | |
parent | abf24ba802c1b13998b4553a96c4f76e95ddae07 (diff) | |
download | FreeBSD-src-89a3ca4811ee4b83778a8ddb7d54874dff19b707.zip FreeBSD-src-89a3ca4811ee4b83778a8ddb7d54874dff19b707.tar.gz |
Vendor import of BIND 9.3.3
Diffstat (limited to 'lib/libc/resolv/mtctxres.c')
-rw-r--r-- | lib/libc/resolv/mtctxres.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c index f33cf11..635bbd4 100644 --- a/lib/libc/resolv/mtctxres.c +++ b/lib/libc/resolv/mtctxres.c @@ -106,9 +106,10 @@ ___mtctxres(void) { */ if (!mt_key_initialized) { static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_lock(&keylock); - _mtctxres_init(); - pthread_mutex_unlock(&keylock); + if (pthread_mutex_lock(&keylock) == 0) { + _mtctxres_init(); + (void) pthread_mutex_unlock(&keylock); + } } /* |