libroot: Fix shared unnamed semaphore acquisition with timeouts.
We set flags above the timeout check, so we need to use |= and not lose the SHARED flag we already set. Fixes some testcases in the POSIX testsuite, and the shared semaphore code in Gecko/Firefox.
This commit is contained in:
@@ -176,10 +176,10 @@ unnamed_sem_timedwait(sem_t* semaphore, clockid_t clock_id,
|
||||
timeoutMicros = -1;
|
||||
switch (clock_id) {
|
||||
case CLOCK_REALTIME:
|
||||
flags = B_ABSOLUTE_REAL_TIME_TIMEOUT;
|
||||
flags |= B_ABSOLUTE_REAL_TIME_TIMEOUT;
|
||||
break;
|
||||
case CLOCK_MONOTONIC:
|
||||
flags = B_ABSOLUTE_TIMEOUT;
|
||||
flags |= B_ABSOLUTE_TIMEOUT;
|
||||
break;
|
||||
default:
|
||||
return EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user