summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2017-03-21 04:45:10 +0000
committerJason Molenda <jmolenda@apple.com>2017-03-21 04:45:10 +0000
commit2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93 (patch)
treef27e0e5634a00556430f635e843a97543abc6b81 /lldb/source/Target/Platform.cpp
parent3724ae4e7092c8145e22f5f1fbe4825c0682b907 (diff)
downloadbcm5719-llvm-2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93.tar.gz
bcm5719-llvm-2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93.zip
Revert r298334 until Zachary has a chance to fix the buildbot failure
on macosx. llvm-svn: 298338
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index acafa8b35c5..ac8a168b93e 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -696,7 +696,8 @@ Error Platform::Install(const FileSpec &src, const FileSpec &dst) {
namespace fs = llvm::sys::fs;
switch (fs::get_file_type(src.GetPath(), false)) {
case fs::file_type::directory_file: {
- llvm::sys::fs::remove(fixed_dst.GetPath());
+ if (GetFileExists(fixed_dst))
+ Unlink(fixed_dst);
uint32_t permissions = src.GetPermissions();
if (permissions == 0)
permissions = eFilePermissionsDirectoryDefault;
@@ -715,12 +716,14 @@ Error Platform::Install(const FileSpec &src, const FileSpec &dst) {
} break;
case fs::file_type::regular_file:
- llvm::sys::fs::remove(fixed_dst.GetPath());
+ if (GetFileExists(fixed_dst))
+ Unlink(fixed_dst);
error = PutFile(src, fixed_dst);
break;
case fs::file_type::symlink_file: {
- llvm::sys::fs::remove(fixed_dst.GetPath());
+ if (GetFileExists(fixed_dst))
+ Unlink(fixed_dst);
FileSpec src_resolved;
error = FileSystem::Readlink(src, src_resolved);
if (error.Success())
OpenPOWER on IntegriCloud