Cygwin: pipes: fix a bug in raw_write

The buffer pointer is incremented by "chunk", which is what we
typically try to write, but this isn't what actually got written.
Increment the buffer pointer by what we actually wrote, as returned
by NtWriteFile.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-09-03 10:24:15 +02:00
parent e9d4cb765f
commit 464f7145f6
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ fhandler_pipe::raw_write (const void *ptr, size_t len)
buffer doesn't have sufficient space. */
if (nbytes_now == 0)
set_errno (EAGAIN);
ptr = ((char *) ptr) + chunk;
ptr = ((char *) ptr) + nbytes_now;
nbytes += nbytes_now;
}
else if (STATUS_PIPE_IS_CLOSED (status))