mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Misc cleanups to the FileSytem api.
The main difference is the removal of std::error_code exists(const Twine &path, bool &result); It was an horribly redundant interface since a file not existing is also a valid error_code. Now we have an access function that returns just an error_code. This is the only function that has to be implemented for Unix and Windows. The functions can_write, exists and can_execute an now just wrappers. One still has to be very careful using these function to avoid introducing race conditions (Time of check to time of use). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -204,8 +204,8 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
|
||||
// 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) {
|
||||
if (sys::fs::access(LockFileName.c_str(), sys::fs::AccessMode::Exist) ==
|
||||
errc::no_such_file_or_directory) {
|
||||
LockFileGone = true;
|
||||
LockFileJustDisappeared = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user