[clang] [llvm] [Support][Modules] Removed prepareForGetLock and its usages. Ensured parent directory exists when creating lock file. (PR #189888)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 6 08:43:28 PDT 2026
================
@@ -182,13 +183,32 @@ Expected<bool> LockFileManager::tryLock() {
}
// Create a lock file that is unique to this instance.
- UniqueLockFileName = LockFileName;
- UniqueLockFileName += "-%%%%%%%%";
int UniqueLockFileID;
- if (std::error_code EC = sys::fs::createUniqueFile(
- UniqueLockFileName, UniqueLockFileID, UniqueLockFileName))
- return createStringError(EC, "failed to create unique file " +
- UniqueLockFileName);
+ {
+ SmallString<128> UniqueLockFilePattern = LockFileName;
+ UniqueLockFilePattern += "-%%%%%%%%";
+ SmallString<128> UniquePath = UniqueLockFilePattern;
+ std::error_code EC =
+ sys::fs::createUniqueFile(UniquePath, UniqueLockFileID, UniquePath);
----------------
jansvoboda11 wrote:
This should take `UniqueLockFilePattern` as the first argument.
https://github.com/llvm/llvm-project/pull/189888
More information about the cfe-commits
mailing list