mirror of
https://github.com/yawut/SDL.git
synced 2026-09-07 08:36:19 -05:00
Fixed bug 1426 - SDL_SemWaitTimeout returns -1 and sets error instead of SDL_MUTEX_TIMEDOUT on time out
deraj 2012-02-19 19:01:08 PST Fix to treat ETIMEDOUT as a time out instead of an error (and update the test)
This commit is contained in:
@@ -150,7 +150,11 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
||||
} while (retval < 0 && errno == EINTR);
|
||||
|
||||
if (retval < 0) {
|
||||
SDL_SetError("sem_timedwait() failed");
|
||||
if (errno == ETIMEDOUT) {
|
||||
retval = SDL_MUTEX_TIMEDOUT;
|
||||
} else {
|
||||
SDL_SetError(strerror(errno));
|
||||
}
|
||||
}
|
||||
#else
|
||||
end = SDL_GetTicks() + timeout;
|
||||
|
||||
Reference in New Issue
Block a user