Commit d7b0699d authored by Michael Pyne's avatar Michael Pyne
Browse files

kshareddatacache: Use proper return value check for timedlock.

I discovered that the return value was being checked as if
pthread_mutex_timedlock used errno for return values while doing a code
review for bug 305023. In reality the only non-error return is 0,
anything else is an error code which is returned directly.

I'm making the fix now so it can join KDE Platform 4.9.1.

CCBUG:305023
parent 74dcd2e9
......@@ -184,7 +184,7 @@ public:
timeout.tv_sec = 10 + ::time(NULL); // Absolute time, so 10 seconds from now
timeout.tv_nsec = 0;
return pthread_mutex_timedlock(&m_mutex, &timeout) >= 0;
return pthread_mutex_timedlock(&m_mutex, &timeout) == 0;
}
};
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment