From c189cce8192f4f6211f130c1b8486ad8c85a159a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 12 Mar 2026 10:22:09 -0400 Subject: [PATCH] io: Remove `iodata->regular_file` check. It wasn't used, and causes an extra fstat(). (cherry picked from commit 803cd7589a18c669421ae36f6a71c9dbba27d188) --- src/io/SDL_iostream.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/io/SDL_iostream.c b/src/io/SDL_iostream.c index cff14fa7dd..98a5cfe366 100644 --- a/src/io/SDL_iostream.c +++ b/src/io/SDL_iostream.c @@ -379,7 +379,6 @@ typedef struct IOStreamFDData { int fd; bool autoclose; - bool regular_file; } IOStreamFDData; static int SDL_fdatasync(int fd) @@ -552,9 +551,6 @@ SDL_IOStream *SDL_IOFromFD(int fd, bool autoclose) iodata->fd = fd; iodata->autoclose = autoclose; - struct stat st; - iodata->regular_file = ((fstat(fd, &st) == 0) && S_ISREG(st.st_mode)); - SDL_IOStream *iostr = SDL_OpenIO(&iface, iodata); if (!iostr) { iface.close(iodata); @@ -577,7 +573,6 @@ typedef struct IOStreamStdioData { FILE *fp; bool autoclose; - bool regular_file; } IOStreamStdioData; #ifdef HAVE_FOPEN64 @@ -754,9 +749,6 @@ SDL_IOStream *SDL_IOFromFP(FILE *fp, bool autoclose) iodata->fp = fp; iodata->autoclose = autoclose; - struct stat st; - iodata->regular_file = ((fstat(fileno(fp), &st) == 0) && S_ISREG(st.st_mode)); - SDL_IOStream *iostr = SDL_OpenIO(&iface, iodata); if (!iostr) { iface.close(iodata);