[llvm-commits] [llvm] r115114 - /llvm/trunk/lib/System/Win32/Path.inc

Francois Pichet pichet2000 at gmail.com
Wed Sep 29 17:44:58 PDT 2010


Author: fpichet
Date: Wed Sep 29 19:44:58 2010
New Revision: 115114

URL: http://llvm.org/viewvc/llvm-project?rev=115114&view=rev
Log:
Revert r114320(move file = copy + delete on Win32). r115040 is a better solution for the Win32 ACCESS_DENIED lit error.

Modified:
    llvm/trunk/lib/System/Win32/Path.inc

Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=115114&r1=115113&r2=115114&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Wed Sep 29 19:44:58 2010
@@ -745,19 +745,12 @@
   return true;
 }
 
-// Implements renamePathOnDisk as a CopyFile + eraseFromDisk on Windows.
-// Using MoveFileEx was causing mysterious ACCESS_DENIED error when used
-// within a multithreaded lit/python context.
-// FIXME: put back MoveFileEx when the source of the problem is resolved.
 bool
 Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) {
-  if (*this == newName)
-    return false;
-  
-  if (CopyFile(newName, *this, ErrMsg))
-    return true;
-  
-  return eraseFromDisk(true, ErrMsg);
+  if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING))
+    return MakeErrMsg(ErrMsg, "Can't move '" + path + "' to '" + newName.path
+        + "': ");
+  return false;
 }
 
 bool





More information about the llvm-commits mailing list