summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index d8db53663f1..4f285e09807 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -523,11 +523,11 @@ void Platform::AddClangModuleCompilationOptions(
FileSpec Platform::GetWorkingDirectory() {
if (IsHost()) {
- char cwd[PATH_MAX];
- if (getcwd(cwd, sizeof(cwd)))
- return FileSpec{cwd, true};
- else
+ llvm::SmallString<64> cwd;
+ if (llvm::sys::fs::current_path(cwd))
return FileSpec{};
+ else
+ return FileSpec(cwd, true);
} else {
if (!m_working_dir)
m_working_dir = GetRemoteWorkingDirectory();
OpenPOWER on IntegriCloud