[PATCH] D82542: [Support][Windows] Prevent 2s delay when renaming a file that does not exist

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 03:10:45 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa27478e54f5f: [Support][Windows] Prevent 2s delay when renaming a file that does not exist (authored by Ben Dunbobbin <Ben.Dunbobbin at sony.com>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82542

Files:
  llvm/lib/Support/Windows/Path.inc


Index: llvm/lib/Support/Windows/Path.inc
===================================================================
--- llvm/lib/Support/Windows/Path.inc
+++ llvm/lib/Support/Windows/Path.inc
@@ -555,6 +555,11 @@
                       NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if (FromHandle)
       break;
+
+    // We don't want to loop if the file doesn't exist.
+    auto EC = mapWindowsError(GetLastError());
+    if (EC == errc::no_such_file_or_directory)
+      return EC;
   }
   if (!FromHandle)
     return mapWindowsError(GetLastError());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82542.275034.patch
Type: text/x-patch
Size: 558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/59fbb3f4/attachment.bin>


More information about the llvm-commits mailing list