src/thread/pthread/SDL_syssem.c
branchSDL-1.2
changeset 6297 c787fb1b5699
parent 6218 f114f1434ff6
--- a/src/thread/pthread/SDL_syssem.c	Mon Feb 20 20:55:23 2012 -0500
+++ b/src/thread/pthread/SDL_syssem.c	Mon Feb 20 23:51:08 2012 -0500
@@ -144,8 +144,14 @@
 		retval = sem_timedwait(&sem->sem, &ts_timeout);
 	while (retval == -1 && errno == EINTR);
 
-	if (retval == -1)
-		SDL_SetError(strerror(errno));
+	if (retval == -1) {
+		if (errno == ETIMEDOUT) {
+			retval = SDL_MUTEX_TIMEDOUT;
+		}
+		else {
+			SDL_SetError(strerror(errno));
+		}
+	}
 #else
 	end = SDL_GetTicks() + timeout;
 	while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {