From 97002d81a793e000fd2dc64f9ca07d36b0664999 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 27 Jan 2025 22:25:12 -0800
Subject: [PATCH] Skip IsRegularFileOrPipe() check on Emscripten
The sandbox guarantees that this will be true.
Fixes https://github.com/libsdl-org/SDL/issues/12108
(backported from from commit 1c7cc602863821ee62dac65d9e3c26fcc2710b3c)
(cherry picked from commit 0efe8892d6c667f9fc712e094d40e8ec7c742a25)
---
src/file/SDL_rwops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c
index 0cf3bfa5f0b7d..76e8cee0904cb 100644
--- a/src/file/SDL_rwops.c
+++ b/src/file/SDL_rwops.c
@@ -533,7 +533,7 @@ static SDL_bool IsRegularFileOrPipe(FILE *f)
!((st.st_mode & _S_IFMT) == _S_IFREG || (st.st_mode & _S_IFMT) == _S_IFIFO)) {
return SDL_FALSE;
}
- #else
+ #elif !defined __EMSCRIPTEN__
struct stat st;
if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
return SDL_FALSE;