summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-21 05:47:57 +0000
committerZachary Turner <zturner@google.com>2017-03-21 05:47:57 +0000
commit07db3f7e3f268c01e66e87608968c5cb71e35f82 (patch)
tree77190cb10ea2358a0c94a8289919bb779d11c6f8 /lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
parent9b7bbeca48b10a0eb81708650777703ce41e67d7 (diff)
downloadbcm5719-llvm-07db3f7e3f268c01e66e87608968c5cb71e35f82.tar.gz
bcm5719-llvm-07db3f7e3f268c01e66e87608968c5cb71e35f82.zip
Resubmit r298334 after fixing OSX build errors.
Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
Diffstat (limited to 'lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp')
-rw-r--r--lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index fe1b1056da1..c6ce3efc8cc 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -435,9 +435,12 @@ PlatformPOSIX::PutFile(const lldb_private::FileSpec &source,
}
lldb::user_id_t PlatformPOSIX::GetFileSize(const FileSpec &file_spec) {
- if (IsHost())
- return FileSystem::GetFileSize(file_spec);
- else if (m_remote_platform_sp)
+ if (IsHost()) {
+ uint64_t Size;
+ if (llvm::sys::fs::file_size(file_spec.GetPath(), Size))
+ return 0;
+ return Size;
+ } else if (m_remote_platform_sp)
return m_remote_platform_sp->GetFileSize(file_spec);
else
return Platform::GetFileSize(file_spec);
@@ -463,7 +466,7 @@ bool PlatformPOSIX::GetFileExists(const FileSpec &file_spec) {
Error PlatformPOSIX::Unlink(const FileSpec &file_spec) {
if (IsHost())
- return FileSystem::Unlink(file_spec);
+ return llvm::sys::fs::remove(file_spec.GetPath());
else if (m_remote_platform_sp)
return m_remote_platform_sp->Unlink(file_spec);
else
OpenPOWER on IntegriCloud