Quellcode durchsuchen

Clarify why we ignore EINVAL when flushing a file descriptor

(cherry picked from commit a1d3fc1f50e8f2587614822e9dcb08d615e861d8)
Sam Lantinga vor 5 Monaten
Ursprung
Commit
e7a1ae0ea5
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      src/io/SDL_iostream.c

+ 1 - 0
src/io/SDL_iostream.c

@@ -455,6 +455,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));
     }
     }