Browse Source

Skip IsRegularFileOrPipe() check on Emscripten

The sandbox guarantees that this will be true.

Fixes https://github.com/libsdl-org/SDL/issues/12108
Sam Lantinga 6 months ago
parent
commit
1c7cc60286
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/io/SDL_iostream.c

+ 3 - 0
src/io/SDL_iostream.c

@@ -788,10 +788,13 @@ static bool SDLCALL mem_close(void *userdata)
 #if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINDOWS)
 static bool IsRegularFileOrPipe(FILE *f)
 {
+#ifndef SDL_PLATFORM_EMSCRIPTEN
     struct stat st;
     if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
         return false;
     }
+#endif // !SDL_PLATFORM_EMSCRIPTEN
+
     return true;
 }
 #endif