summaryrefslogtreecommitdiff
path: root/source/Commands/CommandObjectBugreport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Commands/CommandObjectBugreport.cpp')
-rw-r--r--source/Commands/CommandObjectBugreport.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/Commands/CommandObjectBugreport.cpp b/source/Commands/CommandObjectBugreport.cpp
index 7ba8ab945eae..dc4b9ef302c0 100644
--- a/source/Commands/CommandObjectBugreport.cpp
+++ b/source/Commands/CommandObjectBugreport.cpp
@@ -9,13 +9,9 @@
#include "CommandObjectBugreport.h"
-// C Includes
#include <cstdio>
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionGroupOutputFile.h"
@@ -72,8 +68,6 @@ protected:
const FileSpec &outfile_spec =
m_outfile_options.GetFile().GetCurrentValue();
if (outfile_spec) {
- char path[PATH_MAX];
- outfile_spec.GetPath(path, sizeof(path));
uint32_t open_options =
File::eOpenOptionWrite | File::eOpenOptionCanCreate |
@@ -84,10 +78,13 @@ protected:
open_options |= File::eOpenOptionTruncate;
StreamFileSP outfile_stream = std::make_shared<StreamFile>();
- Status error = outfile_stream->GetFile().Open(path, open_options);
+ File &file = outfile_stream->GetFile();
+ Status error =
+ FileSystem::Instance().Open(file, outfile_spec, open_options);
if (error.Fail()) {
+ auto path = outfile_spec.GetPath();
result.AppendErrorWithFormat("Failed to open file '%s' for %s: %s\n",
- path, append ? "append" : "write",
+ path.c_str(), append ? "append" : "write",
error.AsCString());
result.SetStatus(eReturnStatusFailed);
return false;