Skip to content

Commit 01b29ff

Browse files
committed
Revert "[Support] PR42623: Avoid setting the delete-on-close bit if a TempFile doesn't reside on a local drive"
This reverts commit 79657e2. The change regressed on Windows 7 -- rust-lang/rust#81051
1 parent 686d4f6 commit 01b29ff

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

llvm/lib/Support/Windows/Path.inc

-14
Original file line numberDiff line numberDiff line change
@@ -402,20 +402,6 @@ std::error_code is_local(int FD, bool &Result) {
402402
}
403403

404404
static std::error_code setDeleteDisposition(HANDLE Handle, bool Delete) {
405-
// First, check if the file is on a network (non-local) drive. If so, don't
406-
// set DeleteFile to true, since it prevents opening the file for writes.
407-
SmallVector<wchar_t, 128> FinalPath;
408-
if (std::error_code EC = realPathFromHandle(Handle, FinalPath))
409-
return EC;
410-
411-
bool IsLocal;
412-
if (std::error_code EC = is_local_internal(FinalPath, IsLocal))
413-
return EC;
414-
415-
if (!IsLocal)
416-
return std::error_code();
417-
418-
// The file is on a local drive, set the DeleteFile to true.
419405
FILE_DISPOSITION_INFO Disposition;
420406
Disposition.DeleteFile = Delete;
421407
if (!SetFileInformationByHandle(Handle, FileDispositionInfo, &Disposition,

0 commit comments

Comments
 (0)