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

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 10:33:41 PST 2017


Author: zturner
Date: Fri Mar 10 12:33:41 2017
New Revision: 297488

URL: http://llvm.org/viewvc/llvm-project?rev=297488&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Support/Windows/Path.inc

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=297488&r1=297487&r2=297488&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Fri Mar 10 12:33:41 2017
@@ -857,12 +857,11 @@ std::error_code openFileForRead(const Tw
   }
 
   // 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,




More information about the llvm-commits mailing list