Remove useless Result variable

It always had a statically known value ever since
9399c662f3 "initial import".  The always-true
check for

  Result == osl_cond_result_ok

in the SAL_INFO invocation was apparently a glitch introduced with
a883b6b13b "Improve logging".

Change-Id: I83ebb3fb02c8f080d560fdff86a98ee5f6a9c204
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95513
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2020-06-04 14:49:28 +02:00
parent 56428bd9ad
commit dbcfb91c25

View file

@ -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)