mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 06:28:29 +00:00
x11/wayland: Fix signal handling while blocking in WaitEventTimeout()
Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the flag in WaitEventTimeout() to ensure that a SIGINT will wake up SDL_WaitEvent() without another event coming in.
This commit is contained in:

committed by
Sam Lantinga

parent
c97c46877f
commit
a559864968
@@ -83,7 +83,7 @@ SDL_IOReady(int fd, int flags, int timeoutMS)
|
||||
result = select(fd + 1, rfdp, wfdp, NULL, tvp);
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
} while ( result < 0 && errno == EINTR );
|
||||
} while ( result < 0 && errno == EINTR && !(flags & SDL_IOR_NO_RETRY));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#define SDL_IOR_READ 0x1
|
||||
#define SDL_IOR_WRITE 0x2
|
||||
#define SDL_IOR_NO_RETRY 0x4
|
||||
|
||||
extern int SDL_IOReady(int fd, int flags, int timeoutMS);
|
||||
|
||||
|
Reference in New Issue
Block a user