aboutsummaryrefslogtreecommitdiffstats
path: root/lib/isc/pthreads/mutex.c
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2011-02-05 03:14:55 +0000
committerDoug Barton <dougb@FreeBSD.org>2011-02-05 03:14:55 +0000
commitfccc60c828fe78d2bd780145733aec0ab99dc91f (patch)
tree601b0776df11a070020ab894b76fd90e36393936 /lib/isc/pthreads/mutex.c
parentf805c4c11684ad447d955512cb705ebc2aba9ef3 (diff)
downloadsrc-fccc60c828fe78d2bd780145733aec0ab99dc91f.tar.gz
src-fccc60c828fe78d2bd780145733aec0ab99dc91f.zip
Vendor import of BIND 9.6.3vendor/bind9/9.6.3
Notes
Notes: svn path=/vendor/bind9/dist/; revision=218308 svn path=/vendor/bind9/9.6.3/; revision=218309; tag=vendor/bind9/9.6.3
Diffstat (limited to 'lib/isc/pthreads/mutex.c')
-rw-r--r--lib/isc/pthreads/mutex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/isc/pthreads/mutex.c b/lib/isc/pthreads/mutex.c
index b57d9eee8daa..efe38dba8f80 100644
--- a/lib/isc/pthreads/mutex.c
+++ b/lib/isc/pthreads/mutex.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008, 2011 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.c,v 1.16 2008/04/04 23:47:01 tbox Exp $ */
+/* $Id: mutex.c,v 1.16.112.2 2011-01-04 23:45:43 tbox Exp $ */
/*! \file */
@@ -234,10 +234,13 @@ isc_mutex_init_errcheck(isc_mutex_t *mp)
if (pthread_mutexattr_init(&attr) != 0)
return (ISC_R_UNEXPECTED);
- if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0)
+ if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) {
+ pthread_mutexattr_destroy(&attr);
return (ISC_R_UNEXPECTED);
+ }
err = pthread_mutex_init(mp, &attr) != 0)
+ pthread_mutexattr_destroy(&attr);
if (err == ENOMEM)
return (ISC_R_NOMEMORY);
return ((err == 0) ? ISC_R_SUCCESS : ISC_R_UNEXPECTED);