diff options
Diffstat (limited to 'lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp | 11 |
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 |