git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201289
91177308-0d34-0410-b5e6-
96231b3b80d8
LockFileManager::readLockFile(StringRef LockFileName) {
// Check whether the lock file exists. If not, clearly there's nothing
// to read, so we just return.
LockFileManager::readLockFile(StringRef LockFileName) {
// Check whether the lock file exists. If not, clearly there's nothing
// to read, so we just return.
- bool Exists = false;
- if (sys::fs::exists(LockFileName, Exists) || !Exists)
+ if (!sys::fs::exists(LockFileName))
return None;
// Read the owning host and PID out of the lock file. If it appears that the
return None;
// Read the owning host and PID out of the lock file. If it appears that the
#else
nanosleep(&Interval, NULL);
#endif
#else
nanosleep(&Interval, NULL);
#endif
bool LockFileJustDisappeared = false;
// If the lock file is still expected to be there, check whether it still
// is.
if (!LockFileGone) {
bool LockFileJustDisappeared = false;
// If the lock file is still expected to be there, check whether it still
// is.
if (!LockFileGone) {
if (!sys::fs::exists(LockFileName.str(), Exists) && !Exists) {
LockFileGone = true;
LockFileJustDisappeared = true;
if (!sys::fs::exists(LockFileName.str(), Exists) && !Exists) {
LockFileGone = true;
LockFileJustDisappeared = true;
}
}
// If the lock file is no longer there, check if the original file is
// available now.
if (LockFileGone) {
}
}
// If the lock file is no longer there, check if the original file is
// available now.
if (LockFileGone) {
- if (!sys::fs::exists(FileName.str(), Exists) && Exists) {
+ if (sys::fs::exists(FileName.str())) {