4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-13 04:29:09 +08:00

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>
This commit is contained in:
Corinna Vinschen 2024-08-19 11:44:42 +02:00
parent ef844ce433
commit 61dc66d2f2

View File

@ -551,7 +551,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;