diff options
author | Francois Pichet <pichet2000@gmail.com> | 2010-09-30 00:44:58 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2010-09-30 00:44:58 +0000 |
commit | 3eddd98be31342af81705faf00234b954ff447cf (patch) | |
tree | 03c7fd3ccfc7edf5f9ad57a85b361fe59cb66313 /lib/System | |
parent | 2e38c7f5e676d040d9b8d4d4fbbe4cd5dfc0c1cc (diff) | |
download | llvm-3eddd98be31342af81705faf00234b954ff447cf.tar.gz llvm-3eddd98be31342af81705faf00234b954ff447cf.tar.bz2 llvm-3eddd98be31342af81705faf00234b954ff447cf.tar.xz |
Revert r114320(move file = copy + delete on Win32). r115040 is a better solution for the Win32 ACCESS_DENIED lit error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Win32/Path.inc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index 64e7025fc9..4a6dbd3ddf 100644 --- a/lib/System/Win32/Path.inc +++ b/lib/System/Win32/Path.inc @@ -745,19 +745,12 @@ bool Path::getMagicNumber(std::string& Magic, unsigned len) const { 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 |