summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-21 13:49:50 +0000
committerPavel Labath <labath@google.com>2017-03-21 13:49:50 +0000
commite3ad2e2e73983966b5b84293a0f501e409abddde (patch)
tree9f93fdc91eb2c2526205fa54c3c148b5035b5e10 /lldb/source/Target/Platform.cpp
parent15930862327b0d7120ea4b89ea2a173554db8b90 (diff)
downloadbcm5719-llvm-e3ad2e2e73983966b5b84293a0f501e409abddde.tar.gz
bcm5719-llvm-e3ad2e2e73983966b5b84293a0f501e409abddde.zip
Replace std::ofstream with llvm::raw_fd_ostream
Summary: ofstream does not handle paths with non-ascii characters correctly on windows, so I am switching these to llvm streams to fix that. Reviewers: zturner, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31079 llvm-svn: 298375
Diffstat (limited to 'lldb/source/Target/Platform.cpp')
-rw-r--r--lldb/source/Target/Platform.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index acafa8b35c5..7b9ab0dd6c9 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1645,8 +1645,9 @@ Error Platform::DownloadModuleSlice(const FileSpec &src_file_spec,
const FileSpec &dst_file_spec) {
Error error;
- std::ofstream dst(dst_file_spec.GetPath(), std::ios::out | std::ios::binary);
- if (!dst.is_open()) {
+ std::error_code EC;
+ llvm::raw_fd_ostream dst(dst_file_spec.GetPath(), EC, llvm::sys::fs::F_None);
+ if (EC) {
error.SetErrorStringWithFormat("unable to open destination file: %s",
dst_file_spec.GetPath().c_str());
return error;
OpenPOWER on IntegriCloud