[PATCH] D118212: [Support] [Windows] Don't cancel delete if we failed to set delete

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 03:58:53 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG659bf6d08c00: [Support] [Windows] Don't cancel delete if we failed to set delete (authored by sbaig1, committed by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118212/new/

https://reviews.llvm.org/D118212

Files:
  llvm/lib/Support/Path.cpp


Index: llvm/lib/Support/Path.cpp
===================================================================
--- llvm/lib/Support/Path.cpp
+++ llvm/lib/Support/Path.cpp
@@ -1254,7 +1254,8 @@
 #ifdef _WIN32
   // If we can't cancel the delete don't rename.
   auto H = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
-  std::error_code RenameEC = setDeleteDisposition(H, false);
+  std::error_code RenameEC =
+      RemoveOnClose ? std::error_code() : setDeleteDisposition(H, false);
   bool ShouldDelete = false;
   if (!RenameEC) {
     RenameEC = rename_handle(H, Name);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118212.403584.patch
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/391d6130/attachment.bin>


More information about the llvm-commits mailing list