[Support] Don't return an error if realPath fails.

In openFileForRead, we would not previously return an error
if real_path resolution failed.  After a recent patch, we
started propagating this error up.  This caused a failure
in clang when trying to call openFileForRead("nul").  This
patch restores the previous behavior of not propagating this
error up.

llvm-svn: 297488
This commit is contained in:
Zachary Turner 2017-03-10 18:33:41 +00:00
parent 9dd49054fa
commit 3c0dc33600
1 changed files with 2 additions and 3 deletions

View File

@ -857,12 +857,11 @@ std::error_code openFileForRead(const Twine &Name, int &ResultFD,
}
// Fetch the real name of the file, if the user asked
std::error_code EC;
if (RealPath)
EC = realPathFromHandle(H, *RealPath);
realPathFromHandle(H, *RealPath);
ResultFD = FD;
return EC;
return std::error_code();
}
std::error_code openFileForWrite(const Twine &Name, int &ResultFD,