mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Revert "Fix tmp files being left on Windows builds." for now;
causing some asan test failures. This reverts commit 7daa18215905c831e130c7542f17619e9d936dfc.
This commit is contained in:
parent
32b14b7a99
commit
c06376acba
@ -1229,7 +1229,7 @@ Error TempFile::keep(const Twine &Name) {
|
||||
auto H = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
|
||||
std::error_code RenameEC = setDeleteDisposition(H, false);
|
||||
if (!RenameEC) {
|
||||
RenameEC = rename_handle(H, Name);
|
||||
RenameEC = rename_fd(FD, Name);
|
||||
// If rename failed because it's cross-device, copy instead
|
||||
if (RenameEC ==
|
||||
std::error_code(ERROR_NOT_SAME_DEVICE, std::system_category())) {
|
||||
|
@ -560,6 +560,11 @@ static std::error_code rename_handle(HANDLE FromHandle, const Twine &To) {
|
||||
return errc::permission_denied;
|
||||
}
|
||||
|
||||
static std::error_code rename_fd(int FromFD, const Twine &To) {
|
||||
HANDLE FromHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FromFD));
|
||||
return rename_handle(FromHandle, To);
|
||||
}
|
||||
|
||||
std::error_code rename(const Twine &From, const Twine &To) {
|
||||
// Convert to utf-16.
|
||||
SmallVector<wchar_t, 128> WideFrom;
|
||||
|
Loading…
Reference in New Issue
Block a user