From e7a1ae0ea5a712d5397e424dbc9582c3ff957e00 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Sep 2025 12:11:05 -0700 Subject: [PATCH] Clarify why we ignore EINVAL when flushing a file descriptor (cherry picked from commit a1d3fc1f50e8f2587614822e9dcb08d615e861d8) --- src/io/SDL_iostream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io/SDL_iostream.c b/src/io/SDL_iostream.c index 41748cf6d3..7c982027de 100644 --- a/src/io/SDL_iostream.c +++ b/src/io/SDL_iostream.c @@ -455,6 +455,7 @@ static bool SDLCALL fd_flush(void *userdata, SDL_IOStatus *status) result = SDL_fdatasync(iodata->fd); } while (result < 0 && errno == EINTR); + // We get EINVAL when flushing a pipe, just make that a no-op if (result < 0 && errno != EINVAL) { return SDL_SetError("Error flushing datastream: %s", strerror(errno)); }