[llvm-commits] [llvm] r121094 - /llvm/trunk/lib/Support/Unix/PathV2.inc

Michael J. Spencer bigcheesegs at gmail.com
Mon Dec 6 17:23:39 PST 2010


Author: mspencer
Date: Mon Dec  6 19:23:39 2010
New Revision: 121094

URL: http://llvm.org/viewvc/llvm-project?rev=121094&view=rev
Log:
Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.

Modified:
    llvm/trunk/lib/Support/Unix/PathV2.inc

Modified: llvm/trunk/lib/Support/Unix/PathV2.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=121094&r1=121093&r2=121094&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/PathV2.inc (original)
+++ llvm/trunk/lib/Support/Unix/PathV2.inc Mon Dec  6 19:23:39 2010
@@ -395,9 +395,10 @@
    // Make the path absolute.
   char real_path_buff[PATH_MAX + 1];
   if (realpath(RandomPath.c_str(), real_path_buff) == NULL) {
+    int error = errno;
     ::close(RandomFD);
     ::unlink(RandomPath.c_str());
-    return error_code(errno, system_category());
+    return error_code(error, system_category());
   }
 
   result_path.clear();





More information about the llvm-commits mailing list