summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-19 05:49:43 +0000
committerZachary Turner <zturner@google.com>2017-03-19 05:49:43 +0000
commit6934e0aaa7fa1f081a43e3ceea4c7a865ba015ce (patch)
tree1458713baad812a8f935583cbcd8eead1ee4df9a /lldb/source/Target/Platform.cpp
parent3a86a04404037dd5f0e19a4b866f2d9c082d0c18 (diff)
downloadbcm5719-llvm-6934e0aaa7fa1f081a43e3ceea4c7a865ba015ce.tar.gz
bcm5719-llvm-6934e0aaa7fa1f081a43e3ceea4c7a865ba015ce.zip
Remove FileSystem::Get/SetFilePermissions
Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index d3f265da09e..d92bf12dffa 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -773,9 +773,12 @@ Error Platform::MakeDirectory(const FileSpec &file_spec, uint32_t permissions) {
Error Platform::GetFilePermissions(const FileSpec &file_spec,
uint32_t &file_permissions) {
- if (IsHost())
- return FileSystem::GetFilePermissions(file_spec, file_permissions);
- else {
+ if (IsHost()) {
+ auto Value = llvm::sys::fs::getPermissions(file_spec.GetPath());
+ if (Value)
+ file_permissions = Value.get();
+ return Error(Value.getError());
+ } else {
Error error;
error.SetErrorStringWithFormat("remote platform %s doesn't support %s",
GetPluginName().GetCString(),
@@ -786,9 +789,10 @@ Error Platform::GetFilePermissions(const FileSpec &file_spec,
Error Platform::SetFilePermissions(const FileSpec &file_spec,
uint32_t file_permissions) {
- if (IsHost())
- return FileSystem::SetFilePermissions(file_spec, file_permissions);
- else {
+ if (IsHost()) {
+ auto Perms = static_cast<llvm::sys::fs::perms>(file_permissions);
+ return llvm::sys::fs::setPermissions(file_spec.GetPath(), Perms);
+ } else {
Error error;
error.SetErrorStringWithFormat("remote platform %s doesn't support %s",
GetPluginName().GetCString(),
OpenPOWER on IntegriCloud