Fixed bug #6698 - VISA: wrong check sceKernelPollSema

This commit is contained in:
Sam Lantinga 2022-11-29 08:50:51 -08:00
parent 461a38ff1a
commit f077c69193
1 changed files with 3 additions and 3 deletions

View File

@ -78,15 +78,15 @@ void SDL_DestroySemaphore(SDL_sem *sem)
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
{
Uint32 *pTimeout;
unsigned int res;
int res;
if (sem == NULL) {
return SDL_InvalidParamError("sem");
}
if (timeout == 0) {
int res2 = sceKernelPollSema(sem->semid, 1);
if (res2 < 0) {
res = sceKernelPollSema(sem->semid, 1);
if (res < 0) {
return SDL_MUTEX_TIMEDOUT;
}
return 0;