diff --git a/src/win/fs.c b/src/win/fs.c index 90376414..41aeffdd 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -912,12 +912,11 @@ void fs__read(uv_fs_t* req) { SET_REQ_RESULT(req, bytes); } else { error = GetLastError(); - if (error == ERROR_ACCESS_DENIED) { error = ERROR_INVALID_FLAGS; } - if (error == ERROR_HANDLE_EOF) { + if (error == ERROR_HANDLE_EOF || error == ERROR_BROKEN_PIPE) { SET_REQ_RESULT(req, bytes); } else { SET_REQ_WIN32_ERROR(req, error); diff --git a/test/test-pipe-set-non-blocking.c b/test/test-pipe-set-non-blocking.c index 8246afaf..827e7264 100644 --- a/test/test-pipe-set-non-blocking.c +++ b/test/test-pipe-set-non-blocking.c @@ -46,11 +46,7 @@ static void thread_main(void* arg) { uv_fs_req_cleanup(&req); } while (n > 0 || (n == -1 && uv_errno == UV_EINTR)); -#ifdef _WIN32 - ASSERT(n == UV_EOF); -#else ASSERT(n == 0); -#endif }