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:
Cameron Gutman authored and Sam Lantinga committed 2021-10-30 21:23:45 -07:00
1 parent c97c46877f
commit a559864968
5 files changed
+37 -11

No files matched your search

+1 -1
View File
@@ -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;
}
+1
View File
@@ -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);