summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-06-04 14:49:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-04 23:20:17 +0200
commitdbcfb91c259e8397b3de20f9b3e481b4abadf996 (patch)
tree92654ac8431850db3ac28753b68138474178dd66 /sal
parent56428bd9ad98221ad3631dd1e0d6c80881a88056 (diff)
Remove useless Result variable
It always had a statically known value ever since 9399c662f36c385b0c705eb34e636a9aec450282 "initial import". The always-true check for Result == osl_cond_result_ok in the SAL_INFO invocation was apparently a glitch introduced with a883b6b13b67898accdc1ffe3fd9e770612352b1 "Improve logging". Change-Id: I83ebb3fb02c8f080d560fdff86a98ee5f6a9c204 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95513 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/conditn.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx
index d73d67e91b37..602240922b8c 100644
--- a/sal/osl/unx/conditn.cxx
+++ b/sal/osl/unx/conditn.cxx
@@ -172,7 +172,6 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
{
oslConditionImpl* pCond;
int nRet=0;
- oslConditionResult Result = osl_cond_result_ok;
assert(Condition);
pCond = static_cast<oslConditionImpl*>(Condition);
@@ -206,18 +205,16 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
{
if ( ret == ETIME || ret == ETIMEDOUT )
{
- Result = osl_cond_result_timeout;
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF( nRet != 0, "sal.osl.condition", "osl_waitCondition(" << pCond << "): pthread_mutex_unlock failed: " << UnixErrnoString(nRet) );
- return Result;
+ return osl_cond_result_timeout;
}
if ( ret != EINTR )
{
- Result = osl_cond_result_error;
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF( nRet != 0, "sal.osl.condition", "osl_waitCondition(" << pCond << "): pthread_mutex_unlock failed: " << UnixErrnoString(nRet) );
- return Result;
+ return osl_cond_result_error;
}
}
}
@@ -232,11 +229,10 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
if ( nRet != 0 )
{
SAL_WARN( "sal.osl.condition", "osl_waitCondition(" << pCond << "): pthread_cond_wait failed: " << UnixErrnoString(nRet) );
- Result = osl_cond_result_error;
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF( nRet != 0, "sal.osl.condition", "osl_waitCondition(" << pCond << "): pthread_mutex_unlock failed: " << UnixErrnoString(nRet) );
- return Result;
+ return osl_cond_result_error;
}
}
}
@@ -244,9 +240,9 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF( nRet != 0, "sal.osl.condition", "osl_waitCondition(" << pCond << "): pthread_mutex_unlock failed: " << UnixErrnoString(nRet) );
- SAL_INFO( "sal.osl.condition", "osl_waitCondition(" << pCond << "): " << (Result == osl_cond_result_ok ? "OK" : "ERROR") );
+ SAL_INFO( "sal.osl.condition", "osl_waitCondition(" << pCond << "): OK" );
- return Result;
+ return osl_cond_result_ok;
}
sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)