summaryrefslogtreecommitdiff
path: root/passes/techmap/extract.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/extract.cc')
-rw-r--r--passes/techmap/extract.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/passes/techmap/extract.cc b/passes/techmap/extract.cc
index ebf4d77f..eaa0f9fa 100644
--- a/passes/techmap/extract.cc
+++ b/passes/techmap/extract.cc
@@ -747,11 +747,12 @@ struct ExtractPass : public Pass {
}
}
- FILE *f = fopen(mine_outfile.c_str(), "wt");
- if (f == NULL)
+ std::ofstream f;
+ f.open(mine_outfile.c_str(), std::ofstream::trunc);
+ if (f.fail())
log_error("Can't open output file `%s'.\n", mine_outfile.c_str());
- Backend::backend_call(map, f, mine_outfile, "ilang");
- fclose(f);
+ Backend::backend_call(map, &f, mine_outfile, "ilang");
+ f.close();
}
delete map;