thread: return -1 from SDL_SemWaitTimeout if semaphore is NULL (cherry picked from commit f6db1aba664079e63df44cbb6e6925a088b8f3a8)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/thread/ps2/SDL_syssem.c b/src/thread/ps2/SDL_syssem.c
index a4c7de8..7dc8756 100644
--- a/src/thread/ps2/SDL_syssem.c
+++ b/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) {
diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c
index 293354e..b3d1457 100644
--- a/src/thread/psp/SDL_syssem.c
+++ b/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) {
diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c
index 7fecd6c..0082e00 100644
--- a/src/thread/vita/SDL_syssem.c
+++ b/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) {