Filesystem/Windows: fix inconsistency in readNativeFileSlice API
authorPavel Labath <pavel@labath.sk>
Mon, 19 Aug 2019 15:40:49 +0000 (15:40 +0000)
committerPavel Labath <pavel@labath.sk>
Mon, 19 Aug 2019 15:40:49 +0000 (15:40 +0000)
commit08c77b97c0620b3d8e058e4780bb4f62d81c5958
treec8cc659807db51ecd17d7dd33a5d2fd1e36f5476
parentedfaee08115376467d1c95573de991aebfdaeb42
Filesystem/Windows: fix inconsistency in readNativeFileSlice API

Summary:
The windows version implementation of readNativeFileSlice, was trying to
match the POSIX behavior of not treating EOF as an error, but it was
only handling the case of reading from a pipe. Attempting to read past
the end of a regular file returns a slightly different error code, which
needs to be handled too. This patch adds ERROR_HANDLE_EOF to the list of
error codes to be treated as an end of file, and adds some unit tests
for the API.

This issue was found while attempting to land D66224, which caused a bunch of
lldb tests to start failing on windows.

Reviewers: rnk, aganea

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66344

llvm-svn: 369269
llvm/lib/Support/Windows/Path.inc
llvm/unittests/Support/Path.cpp