summaryrefslogtreecommitdiff
path: root/passes/techmap/dfflibmap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/dfflibmap.cc')
-rw-r--r--passes/techmap/dfflibmap.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/passes/techmap/dfflibmap.cc b/passes/techmap/dfflibmap.cc
index 6ce771ac..7e39040c 100644
--- a/passes/techmap/dfflibmap.cc
+++ b/passes/techmap/dfflibmap.cc
@@ -463,11 +463,12 @@ struct DfflibmapPass : public Pass {
if (liberty_file.empty())
log_cmd_error("Missing `-liberty liberty_file' option!\n");
- FILE *f = fopen(liberty_file.c_str(), "r");
- if (f == NULL)
+ std::ifstream f;
+ f.open(liberty_file.c_str());
+ if (f.fail())
log_cmd_error("Can't open liberty file `%s': %s\n", liberty_file.c_str(), strerror(errno));
LibertyParser libparser(f);
- fclose(f);
+ f.close();
find_cell(libparser.ast, "$_DFF_N_", false, false, false, false);
find_cell(libparser.ast, "$_DFF_P_", true, false, false, false);