http://bugs.winehq.org/show_bug.cgi?id=58745
--- Comment #6 from Robin Haberkorn rhaberkorn@fmsbw.de --- (In reply to Eric Pouech from comment #5)
in glib: in the _S_IFIFO case, I'd do something like: (it's possible that PeekNamedPipe has been used to work around blocking reads on pipe:s)
Yes, that's what the glib maintainers say.
so perhaps a very simple hack would be to add after readable and writable have been set something like: if (GetFileType(pipe) == FILE_TYPE_PIPE && !channel->is_readable && !channel->is_writable) channel->is_readable = 1; (it's broken if the pipe is neither readable nor writable, but detects if the pipe handle is still valid, and doesn't use ReadFile in case of blocking reads) also not tested (or falling back to ReadFile)
Somebody is suggesting to DuplicateHandle() and set the PIPE_NOWAIT mode before trying a zero ReadFile().