summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
diff options
context:
space:
mode:
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