From 1ed909e047a22b8a2bdaed437d9dc974571835b8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 19 Aug 2024 11:44:42 +0200 Subject: 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 --- winsup/cygwin/fhandler/pipe.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'winsup/cygwin') 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; -- cgit v1.1