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.
This commit is contained in:
Jameson Nash 2024-09-05 09:46:37 -04:00 committed by GitHub
parent 5ff1fc724f
commit 0a00e80c36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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