aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-08-19 11:44:42 +0200
committerCorinna Vinschen <corinna@vinschen.de>2024-08-19 11:44:42 +0200
commit1ed909e047a22b8a2bdaed437d9dc974571835b8 (patch)
tree3977ee38d3da116d7429177e31c1dff2950c4f2d /winsup/cygwin
parent170e6badb621fc07d236e540c693ea5deb53fc27 (diff)
downloadnewlib-1ed909e047a22b8a2bdaed437d9dc974571835b8.zip
newlib-1ed909e047a22b8a2bdaed437d9dc974571835b8.tar.gz
newlib-1ed909e047a22b8a2bdaed437d9dc974571835b8.tar.bz2
Cygwin: pipe: fix comparison
There's no reason to overwrite len1 with align if they are the same value. Fixes: 170e6badb621 ("Cygwin: pipe: improve writing when pipe buffer is almost full") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/fhandler/pipe.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler/pipe.cc b/winsup/cygwin/fhandler/pipe.cc
index 33ab117..34b295c 100644
--- a/winsup/cygwin/fhandler/pipe.cc
+++ b/winsup/cygwin/fhandler/pipe.cc
@@ -566,7 +566,7 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len)
PDA_WRITE);
if (avail < 1) /* error or pipe closed */
break;
- if (avail >= len1) /* somebody read from the pipe */
+ if (avail > len1) /* somebody read from the pipe */
avail = len1;
if (avail == 1) /* 1 byte left or non-Cygwin pipe */
len1 >>= 1;