Browse Source

thread: return -1 from SDL_SemWaitTimeout if semaphore is NULL

(cherry picked from commit f6db1aba664079e63df44cbb6e6925a088b8f3a8)
pionere 2 years ago
parent
commit
ee13e8c76b
3 changed files with 3 additions and 6 deletions
  1. 1 2
      src/thread/ps2/SDL_syssem.c
  2. 1 2
      src/thread/psp/SDL_syssem.c
  3. 1 2
      src/thread/vita/SDL_syssem.c

+ 1 - 2
src/thread/ps2/SDL_syssem.c

@@ -87,8 +87,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
     InitializeTimerAlarm(&alarm);
     
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {

+ 1 - 2
src/thread/psp/SDL_syssem.c

@@ -82,8 +82,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
     int res;
 
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {

+ 1 - 2
src/thread/vita/SDL_syssem.c

@@ -83,8 +83,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
        unsigned int res;
 
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {