aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/LockFileManager.cpp
diff options
context:
space:
mode:
authorMichael Spencer <bigcheesegs@gmail.com>2024-03-02 02:29:08 -0800
committerGitHub <noreply@github.com>2024-03-02 02:29:08 -0800
commitc4f59937cae95a576635848b36a23b0d672f71d6 (patch)
treeb7cd4830ce1b8f9b0a955611d2e8a1c5287df764 /llvm/lib/Support/LockFileManager.cpp
parentb14220e075fe47f4d61632e80a6d0a4a955a7c97 (diff)
downloadllvm-c4f59937cae95a576635848b36a23b0d672f71d6.zip
llvm-c4f59937cae95a576635848b36a23b0d672f71d6.tar.gz
llvm-c4f59937cae95a576635848b36a23b0d672f71d6.tar.bz2
[llvm][Support] Call clear_error in LockFileManager to avoid report_fatal_error (#83655)
As per the comment in `raw_fd_ostream`'s destructor, you must call `clear_error()` to prevent a call to `report_fatal_error()`. There's not really a way to test this, but we did encounter it in the wild. rdar://117347895
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r--llvm/lib/Support/LockFileManager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index 34c7a16..facdc5a 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -205,6 +205,8 @@ LockFileManager::LockFileManager(StringRef FileName)
S.append(std::string(UniqueLockFileName));
setError(Out.error(), S);
sys::fs::remove(UniqueLockFileName);
+ // Don't call report_fatal_error.
+ Out.clear_error();
return;
}
}