diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-10 21:40:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-10 21:40:29 +0000 |
commit | 81e7fd011fa0fab28b23c787e2ab66fc1bc9a926 (patch) | |
tree | 2a53ca73dcc53598adb93818ec728008e8f0841f /llvm/lib/Support/LockFileManager.cpp | |
parent | 2a008784d36f492b1fbead7a0f2e7c838ea0befb (diff) | |
download | bcm5719-llvm-81e7fd011fa0fab28b23c787e2ab66fc1bc9a926.tar.gz bcm5719-llvm-81e7fd011fa0fab28b23c787e2ab66fc1bc9a926.zip |
Use the simpler version of sys::fs::remove when possible.
llvm-svn: 198958
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r-- | llvm/lib/Support/LockFileManager.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index eeec274ad8e..5f153a9f795 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -111,8 +111,7 @@ LockFileManager::LockFileManager(StringRef FileName) // We failed to write out PID, so make up an excuse, remove the // unique lock file, and fail. Error = make_error_code(errc::no_space_on_device); - bool Existed; - sys::fs::remove(UniqueLockFileName.c_str(), Existed); + sys::fs::remove(UniqueLockFileName.c_str()); return; } } @@ -137,14 +136,13 @@ LockFileManager::LockFileManager(StringRef FileName) // Someone else managed to create the lock file first. Wipe out our unique // lock file (it's useless now) and read the process ID from the lock file. - bool Existed; - sys::fs::remove(UniqueLockFileName.str(), Existed); + sys::fs::remove(UniqueLockFileName.str()); if ((Owner = readLockFile(LockFileName))) return; // There is a lock file that nobody owns; try to clean it up and report // an error. - sys::fs::remove(LockFileName.str(), Existed); + sys::fs::remove(LockFileName.str()); Error = EC; } @@ -163,9 +161,8 @@ LockFileManager::~LockFileManager() { return; // Since we own the lock, remove the lock file and our own unique lock file. - bool Existed; - sys::fs::remove(LockFileName.str(), Existed); - sys::fs::remove(UniqueLockFileName.str(), Existed); + sys::fs::remove(LockFileName.str()); + sys::fs::remove(UniqueLockFileName.str()); } void LockFileManager::waitForUnlock() { |