# SDL: Fixed bug #6698 - VISA: wrong check sceKernelPollSema (f077c)

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-bug-6698-visa-wrong-check-scekernelpollsema-f077c/40758>\
**Category:** SDL Commits\
**Created:** [November 29, 2022, 4:52pm UTC](https://discourse.libsdl.org/t/sdl-fixed-bug-6698-visa-wrong-check-scekernelpollsema-f077c/40758 "2022-11-29T16:52:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [November 29, 2022, 4:52pm UTC](https://discourse.libsdl.org/t/sdl-fixed-bug-6698-visa-wrong-check-scekernelpollsema-f077c/40758/1 "2022-11-29T16:52:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/f077c691930f70a2e826eb40cbd0e35a7465a4af>

```diff
From f077c691930f70a2e826eb40cbd0e35a7465a4af Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 29 Nov 2022 08:50:51 -0800
Subject: [PATCH] Fixed bug #6698 - VISA: wrong check sceKernelPollSema

---
 src/thread/vita/SDL_syssem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c
index f0f3f8765588..6de993b03f62 100644
--- a/src/thread/vita/SDL_syssem.c
+++ b/src/thread/vita/SDL_syssem.c
@@ -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;

```
