diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-13 19:26:06 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-13 19:26:06 +0000 |
| commit | 267829774358b5aebd3e726ae318813bd48129bb (patch) | |
| tree | 5a8904da0d9716ea10b69258f5d50e0b1ee2ec2c /ELF/Filesystem.cpp | |
| parent | 0317860f00ca8e821989c92c8a6cc461fd5f2009 (diff) | |
Notes
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 |
