From 0a00e80c3686b93eccb9a801954e86bd7d7fe6ab Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 5 Sep 2024 09:46:37 -0400 Subject: [PATCH] win,pipe: fix another missing assignment to success (#4523) Yet another followup to #4511. The functional/legacy/increment_spec.lua test failed most of the time without this, and passes consistently with it. It seemed unexpected this code path gets reached (perhaps imply that the user wrote zero bytes?), but good to fix of course. --- src/win/pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/win/pipe.c b/src/win/pipe.c index 5a324bb0..76ea169e 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -1983,6 +1983,7 @@ static int uv__pipe_read_data(uv_loop_t* loop, } else { if (max_bytes > bytes_available) max_bytes = bytes_available; + *bytes_read = 0; if (max_bytes == 0 || ReadFile(handle->handle, buf.base, max_bytes, bytes_read, NULL)) r = ERROR_SUCCESS; else