From e953f86b951fa980dc1161973761d4bed571b8aa Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 10 Mar 2017 18:33:41 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297488 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Windows/Path.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index c7582894fa9..d8a14b41cb2 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -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, -- 2.50.1