[PATCH] D34917: ELF: Only unlink regular files

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 09:04:04 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL307092: ELF: Only unlink regular files (authored by tstellar).

Repository:
  rL LLVM

https://reviews.llvm.org/D34917

Files:
  lld/trunk/ELF/Filesystem.cpp


Index: lld/trunk/ELF/Filesystem.cpp
===================================================================
--- lld/trunk/ELF/Filesystem.cpp
+++ lld/trunk/ELF/Filesystem.cpp
@@ -38,7 +38,8 @@
 // This function spawns a background thread to call unlink.
 // The calling thread returns almost immediately.
 void elf::unlinkAsync(StringRef Path) {
-  if (!Config->Threads || !sys::fs::exists(Config->OutputFile))
+  if (!Config->Threads || !sys::fs::exists(Config->OutputFile) ||
+      !sys::fs::is_regular_file(Config->OutputFile))
     return;
 
   // First, rename Path to avoid race condition. We cannot remove


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34917.105184.patch
Type: text/x-patch
Size: 609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170704/22218ffd/attachment-0001.bin>


More information about the llvm-commits mailing list