summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp')
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index f68fd5a1400..5cd3a6c777d 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -1245,10 +1245,10 @@ public:
std::error_code writeFile(const lld::File &file, StringRef outPath) override {
// Create stream to path.
- std::string errorInfo;
- llvm::raw_fd_ostream out(outPath.data(), errorInfo, llvm::sys::fs::F_Text);
- if (!errorInfo.empty())
- return make_error_code(llvm::errc::no_such_file_or_directory);
+ std::error_code ec;
+ llvm::raw_fd_ostream out(outPath.data(), ec, llvm::sys::fs::F_Text);
+ if (ec)
+ return ec;
// Create yaml Output writer, using yaml options for context.
YamlContext yamlContext;
OpenPOWER on IntegriCloud