Clarify why we ignore EINVAL when flushing a file descriptor

This commit is contained in:
Sam Lantinga
2025-09-14 12:11:05 -07:00
parent e40d337a47
commit a1d3fc1f50

View File

@@ -502,6 +502,7 @@ static bool SDLCALL fd_flush(void *userdata, SDL_IOStatus *status)
result = SDL_fdatasync(iodata->fd); result = SDL_fdatasync(iodata->fd);
} while (result < 0 && errno == EINTR); } while (result < 0 && errno == EINTR);
// We get EINVAL when flushing a pipe, just make that a no-op
if (result < 0 && errno != EINVAL) { if (result < 0 && errno != EINVAL) {
return SDL_SetError("Error flushing datastream: %s", strerror(errno)); return SDL_SetError("Error flushing datastream: %s", strerror(errno));
} }