mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 11:28:15 +00:00
Skip IsRegularFileOrPipe() check on Emscripten
The sandbox guarantees that this will be true. Fixes https://github.com/libsdl-org/SDL/issues/12108
This commit is contained in:
@@ -788,10 +788,13 @@ static bool SDLCALL mem_close(void *userdata)
|
|||||||
#if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINDOWS)
|
#if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINDOWS)
|
||||||
static bool IsRegularFileOrPipe(FILE *f)
|
static bool IsRegularFileOrPipe(FILE *f)
|
||||||
{
|
{
|
||||||
|
#ifndef SDL_PLATFORM_EMSCRIPTEN
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
|
if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif // !SDL_PLATFORM_EMSCRIPTEN
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user