mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 05:46:00 +00:00
Make sure stdio handles are in blocking mode
Standard I/O doesn't work well with non-blocking handles, so make sure any pipes are in blocking mode before launching child processes. Fixes https://github.com/libsdl-org/SDL/issues/10998
This commit is contained in:
@@ -73,6 +73,14 @@ static bool SetupRedirect(SDL_PropertiesID props, const char *property, HANDLE *
|
||||
WIN_SetError("DuplicateHandle()");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetFileType(*result) == FILE_TYPE_PIPE) {
|
||||
DWORD wait_mode = PIPE_WAIT;
|
||||
if (!SetNamedPipeHandleState(*result, &wait_mode, NULL, NULL)) {
|
||||
WIN_SetError("SetNamedPipeHandleState()");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user