summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/LockFileManager.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-13 04:00:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-13 04:00:35 +0000
commit9e7a638be1a3bbdec85dc70f483461de9bc84038 (patch)
tree382fb4e260e6791b5bba597c4d8dd6e1335eb3da /llvm/lib/Support/LockFileManager.cpp
parent5fd0c9d032bda1a3a8ab134ec13e6ece1c023772 (diff)
downloadbcm5719-llvm-9e7a638be1a3bbdec85dc70f483461de9bc84038.tar.gz
bcm5719-llvm-9e7a638be1a3bbdec85dc70f483461de9bc84038.zip
Use simpler version of sys::fs::exists when possible.
llvm-svn: 201289
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r--llvm/lib/Support/LockFileManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index 5f153a9f795..c7c51e646b1 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -31,8 +31,7 @@ Optional<std::pair<std::string, int> >
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
@@ -189,23 +188,22 @@ void LockFileManager::waitForUnlock() {
#else
nanosleep(&Interval, NULL);
#endif
- bool Exists = false;
bool LockFileJustDisappeared = false;
// If the lock file is still expected to be there, check whether it still
// is.
if (!LockFileGone) {
+ bool Exists;
if (!sys::fs::exists(LockFileName.str(), Exists) && !Exists) {
LockFileGone = true;
LockFileJustDisappeared = true;
- Exists = false;
}
}
// 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())) {
return;
}
OpenPOWER on IntegriCloud