https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d83183e4f73224210f4179cb96c0beff1d2605de

commit d83183e4f73224210f4179cb96c0beff1d2605de
Author:     Corinna Vinschen <[email protected]>
AuthorDate: Mon Aug 19 11:51:14 2024 +0200
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Thu Aug 22 19:58:49 2024 +0200

    Cygwin: pipe: do short writes only once in nonblocking case too
    
    If a nonblocking write requires short writes, just try it once
    as in the blocking case.  After all, we are nonblocking, so
    don't loop unnecessarily.
    
    Fixes: 170e6badb621 ("Cygwin: pipe: improve writing when pipe buffer is 
almost full")
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/fhandler/pipe.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler/pipe.cc b/winsup/cygwin/fhandler/pipe.cc
index 3f8d5479c5f1..6658a23e7f6f 100644
--- a/winsup/cygwin/fhandler/pipe.cc
+++ b/winsup/cygwin/fhandler/pipe.cc
@@ -559,8 +559,7 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len)
            len1 = avail & ~(PIPE_BUF - 1);
          else
            len1 = 1 << (31 - __builtin_clzl (avail));
-         if (!is_nonblocking ())
-           short_write_once = true;
+         short_write_once = true;
        }
       if (isclosed ())  /* A signal handler might have closed the fd. */
        {

Reply via email to