aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 2f80cdb..63d8d4e 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -1254,7 +1254,8 @@ Error TempFile::keep(const Twine &Name) {
#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);