diff options
Diffstat (limited to 'ELF/Filesystem.cpp')
| -rw-r--r-- | ELF/Filesystem.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ELF/Filesystem.cpp b/ELF/Filesystem.cpp index b63d521a83b0..d468ae0c618a 100644 --- a/ELF/Filesystem.cpp +++ b/ELF/Filesystem.cpp @@ -38,7 +38,8 @@ using namespace lld::elf; // 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 |
