[PATCH] Cygwin: pipe: Restore non-blocking mode which was reset for non-cygwin app.

Takashi Yano takashi.yano@nifty.ne.jp
Mon Mar 11 23:17:22 GMT 2024


On Tue, 12 Mar 2024 08:03:16 +0900
Takashi Yano wrote:
> +  /* Set read pipe itself always non-blocking for cygwin process.
> +     Blocking/non-blocking is simulated in raw_read(). For write
> +     pipe, follow is_nonblocking(). */
> +  int fd;
> +  cygheap_fdenum cfd (false);
> +  while ((fd = cfd.next ()) >= 0)
> +    if (cfd->get_dev () == FH_PIPEW
> +	&& (fd == fileno_stdout || fd == fileno_stderr))
> +      {
> +	fhandler_pipe *pipe = (fhandler_pipe *)(fhandler_base *) cfd;
> +	pipe->set_pipe_non_blocking (false);

Sorry. Commenting here is not right. v4 patch attached.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: v4-0001-Cygwin-pipe-Make-sure-to-set-read-pipe-non-blocki.patch
URL: <https://cygwin.com/pipermail/cygwin-patches/attachments/20240312/e71cacf9/attachment.ksh>


More information about the Cygwin-patches mailing list