From 01b29ff7fe2dd543e1f3e59d2a5e1727e04e98a0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 26 Feb 2021 16:06:08 -0800 Subject: [PATCH] Revert "[Support] PR42623: Avoid setting the delete-on-close bit if a TempFile doesn't reside on a local drive" This reverts commit 79657e2339b58bc01fe1b85a448bb073d57d90bb. The change regressed on Windows 7 -- rust-lang/rust#81051 --- llvm/lib/Support/Windows/Path.inc | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index dc9bcf8683810..399b054d36bd2 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -402,20 +402,6 @@ std::error_code is_local(int FD, bool &Result) { } static std::error_code setDeleteDisposition(HANDLE Handle, bool Delete) { - // First, check if the file is on a network (non-local) drive. If so, don't - // set DeleteFile to true, since it prevents opening the file for writes. - SmallVector FinalPath; - if (std::error_code EC = realPathFromHandle(Handle, FinalPath)) - return EC; - - bool IsLocal; - if (std::error_code EC = is_local_internal(FinalPath, IsLocal)) - return EC; - - if (!IsLocal) - return std::error_code(); - - // The file is on a local drive, set the DeleteFile to true. FILE_DISPOSITION_INFO Disposition; Disposition.DeleteFile = Delete; if (!SetFileInformationByHandle(Handle, FileDispositionInfo, &Disposition,