diff options
Diffstat (limited to 'source/Host/common/Editline.cpp')
-rw-r--r-- | source/Host/common/Editline.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/Host/common/Editline.cpp b/source/Host/common/Editline.cpp index 1c5c0ffe902b..b157cdb7c110 100644 --- a/source/Host/common/Editline.cpp +++ b/source/Host/common/Editline.cpp @@ -11,16 +11,19 @@ #include <iostream> #include <limits.h> -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" -#include "lldb/Core/StringList.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Editline.h" -#include "lldb/Host/FileSpec.h" -#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/FileSpec.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/SelectHelper.h" +#include "lldb/Utility/StreamString.h" +#include "lldb/Utility/StringList.h" +#include "lldb/Utility/Timeout.h" + +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/Threading.h" using namespace lldb_private; using namespace lldb_private::line_editor; @@ -176,9 +179,7 @@ private: if (m_path.empty() && m_history && !m_prefix.empty()) { FileSpec parent_path{"~/.lldb", true}; char history_path[PATH_MAX]; - if (FileSystem::MakeDirectory(parent_path, - lldb::eFilePermissionsDirectoryDefault) - .Success()) { + if (!llvm::sys::fs::create_directory(parent_path.GetPath())) { snprintf(history_path, sizeof(history_path), "~/.lldb/%s-history", m_prefix.c_str()); } else { @@ -1151,8 +1152,8 @@ Editline::Editline(const char *editline_name, FILE *input_file, if (term_fd != -1) { static std::mutex *g_init_terminal_fds_mutex_ptr = nullptr; static std::set<int> *g_init_terminal_fds_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, [&]() { + static llvm::once_flag g_once_flag; + llvm::call_once(g_once_flag, [&]() { g_init_terminal_fds_mutex_ptr = new std::mutex(); // NOTE: Leak to avoid C++ destructor chain issues g_init_terminal_fds_ptr = new std::set<int>(); // NOTE: Leak to avoid |