Use std::error_code instead of llvm::error_code.
[oota-llvm.git] / lib / Support / LockFileManager.cpp
index fb07801a14b630100843dd23e247d3f0c7427022..2b7fc812d51972700ee0fcceb989609b03384a5c 100644 (file)
@@ -114,7 +114,7 @@ LockFileManager::LockFileManager(StringRef FileName)
     if (Out.has_error()) {
       // 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);
+      Error = make_error_code(std::errc::no_space_on_device);
       sys::fs::remove(UniqueLockFileName.c_str());
       return;
     }
@@ -124,10 +124,10 @@ LockFileManager::LockFileManager(StringRef FileName)
     // Create a link from the lock file name. If this succeeds, we're done.
     error_code EC =
         sys::fs::create_link(UniqueLockFileName.str(), LockFileName.str());
-    if (EC == errc::success)
+    if (!EC)
       return;
 
-    if (EC != errc::file_exists) {
+    if (EC != std::errc::file_exists) {
       Error = EC;
       return;
     }
@@ -196,7 +196,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
 #if LLVM_ON_WIN32
     Sleep(Interval);
 #else
-    nanosleep(&Interval, NULL);
+    nanosleep(&Interval, nullptr);
 #endif
     bool LockFileJustDisappeared = false;