Use Host::File in lldb_private::StreamFile and other places to cleanup host
layer a bit more.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125149 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBStream.cpp b/source/API/SBStream.cpp
index b8a18a1..661c0f0 100644
--- a/source/API/SBStream.cpp
+++ b/source/API/SBStream.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/API/SBStream.h"
 
+#include "lldb/Core/Error.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/StreamString.h"
@@ -75,7 +76,13 @@
         if (!m_is_file)
             local_data.swap(static_cast<StreamString *>(m_opaque_ap.get())->GetString());
     }
-    m_opaque_ap.reset (new StreamFile (path, append ? "a" : "w"));
+    StreamFile *stream_file = new StreamFile;
+    uint32_t open_options = File::eOpenOptionWrite | File::eOpenOptionCanCreate;
+    if (append)
+        open_options |= File::eOpenOptionAppend;
+    stream_file->GetFile().Open (path, open_options, File::ePermissionsDefault);
+
+    m_opaque_ap.reset (stream_file);
 
     if (m_opaque_ap.get())
     {