summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2011-04-14 12:06:02 +0200
committerThorsten Behrens <tbehrens@novell.com>2011-04-14 12:27:53 +0200
commit7654c346ec58955e14253d13bf3bd9eb4ce4a3e6 (patch)
treed966160533ed56044b54b14eb888cc79e5196926
parent8f7e06c3d327376ebc29d103bf00c904d9654ad2 (diff)
Added error handling for pthread_mutexattr_settype.
This fixes a dead assignment reported by CLang++.
-rw-r--r--sal/osl/unx/mutex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sal/osl/unx/mutex.c b/sal/osl/unx/mutex.c
index c44b33246..d4ca66d03 100644
--- a/sal/osl/unx/mutex.c
+++ b/sal/osl/unx/mutex.c
@@ -72,11 +72,11 @@ oslMutex SAL_CALL osl_createMutex()
pthread_mutexattr_init(&aMutexAttr);
nRet = pthread_mutexattr_settype(&aMutexAttr, PTHREAD_MUTEX_RECURSIVE);
-
- nRet = pthread_mutex_init(&(pMutex->mutex), &aMutexAttr);
+ if( nRet == 0 )
+ nRet = pthread_mutex_init(&(pMutex->mutex), &aMutexAttr);
if ( nRet != 0 )
{
- OSL_TRACE("osl_createMutex : mutex init failed. Errno: %d; %s\n",
+ OSL_TRACE("osl_createMutex : mutex init/setattr failed. Errno: %d; %s\n",
nRet, strerror(nRet));
free(pMutex);