Skip to content

Commit 4702b7e

Browse files
committed
LockFileManager
1 parent 36094dc commit 4702b7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Support/LockFileManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ Expected<bool> LockFileManager::tryLock() {
167167
assert(std::holds_alternative<OwnerUnknown>(Owner) &&
168168
"lock has already been attempted");
169169

170+
[[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable();
171+
170172
SmallString<128> AbsoluteFileName(FileName);
171173
if (std::error_code EC = sys::fs::make_absolute(AbsoluteFileName))
172174
return createStringError(EC, "failed to obtain absolute path for " +
@@ -264,6 +266,8 @@ LockFileManager::~LockFileManager() {
264266

265267
WaitForUnlockResult
266268
LockFileManager::waitForUnlockFor(std::chrono::seconds MaxSeconds) {
269+
[[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable();
270+
267271
auto *LockFileOwner = std::get_if<OwnedByAnother>(&Owner);
268272
assert(LockFileOwner &&
269273
"waiting for lock to be unlocked without knowing the owner");
@@ -293,5 +297,7 @@ LockFileManager::waitForUnlockFor(std::chrono::seconds MaxSeconds) {
293297
}
294298

295299
std::error_code LockFileManager::unsafeMaybeUnlock() {
300+
[[maybe_unused]] auto BypassSandbox = sys::sandbox::scopedDisable();
301+
296302
return sys::fs::remove(LockFileName);
297303
}

0 commit comments

Comments
 (0)