summaryrefslogtreecommitdiff
path: root/tools/opt/GraphPrinters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/opt/GraphPrinters.cpp')
-rw-r--r--tools/opt/GraphPrinters.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp
index 6bd0a6e9f7..c38469cc12 100644
--- a/tools/opt/GraphPrinters.cpp
+++ b/tools/opt/GraphPrinters.cpp
@@ -28,9 +28,10 @@ static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
const GraphType &GT) {
std::string Filename = GraphName + ".dot";
O << "Writing '" << Filename << "'...";
- std::ofstream F(Filename.c_str());
+ std::string ErrInfo;
+ raw_fd_ostream F(Filename.c_str(), ErrInfo, raw_fd_ostream::F_Force);
- if (F.good())
+ if (ErrInfo.empty())
WriteGraph(F, GT);
else
O << " error opening file for writing!";