Use file descriptor I/O for process pipes
Use low level non-blocking I/O for process pipe streams. This may fix issues with data not getting through the pipe occasionally. Related: https://github.com/libsdl-org/SDL/issues/11006
This commit is contained in:
@@ -57,12 +57,7 @@ static bool SetupStream(SDL_Process *process, int fd, const char *mode, const ch
|
||||
// Set the file descriptor to non-blocking mode
|
||||
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
|
||||
|
||||
FILE *fp = fdopen(fd, mode);
|
||||
if (!fp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_IOStream *io = SDL_IOFromFP(fp, true);
|
||||
SDL_IOStream *io = SDL_IOFromFD(fd, true);
|
||||
if (!io) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user