summaryrefslogtreecommitdiff
path: root/include/llvm/Support/LockFileManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/LockFileManager.h')
-rw-r--r--include/llvm/Support/LockFileManager.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/Support/LockFileManager.h b/include/llvm/Support/LockFileManager.h
index 13d252425b93a..1e417bdd5b253 100644
--- a/include/llvm/Support/LockFileManager.h
+++ b/include/llvm/Support/LockFileManager.h
@@ -11,6 +11,7 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/FileSystem.h"
#include <system_error>
#include <utility> // for std::pair
@@ -53,10 +54,10 @@ public:
private:
SmallString<128> FileName;
SmallString<128> LockFileName;
- SmallString<128> UniqueLockFileName;
+ Optional<sys::fs::TempFile> UniqueLockFile;
Optional<std::pair<std::string, int> > Owner;
- Optional<std::error_code> Error;
+ std::error_code ErrorCode;
std::string ErrorDiagMsg;
LockFileManager(const LockFileManager &) = delete;
@@ -88,8 +89,8 @@ public:
std::string getErrorMessage() const;
/// \brief Set error and error message
- void setError(std::error_code &EC, StringRef ErrorMsg = "") {
- Error = EC;
+ void setError(const std::error_code &EC, StringRef ErrorMsg = "") {
+ ErrorCode = EC;
ErrorDiagMsg = ErrorMsg.str();
}
};