summaryrefslogtreecommitdiff
path: root/passes/abc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-03-11 14:24:24 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-11 14:24:24 +0100
commit91704a78531bec2e3eea3ddf90eaedb28e1d696d (patch)
treea3817eb12cebb9e9adc0f2375eda59ddb2d9004a /passes/abc
parent9992026a8d4482abd8fbae8cb246a87cbbbde364 (diff)
Merged a few fixes for non-posix systems from github.com/Siesh1oo/yosys
(see https://github.com/cliffordwolf/yosys/pull/28)
Diffstat (limited to 'passes/abc')
-rw-r--r--passes/abc/abc.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc
index 2829e660..286b750c 100644
--- a/passes/abc/abc.cc
+++ b/passes/abc/abc.cc
@@ -43,7 +43,9 @@
#include <stdio.h>
#include <string.h>
#include <dirent.h>
+#include <cerrno>
#include <sstream>
+#include <climits>
#include "blifparse.h"
@@ -973,7 +975,11 @@ struct AbcPass : public Pass {
int lut_mode = 0;
size_t argidx;
- char *pwd = get_current_dir_name();
+ char pwd [PATH_MAX];
+ if (!getcwd(pwd, sizeof(pwd))) {
+ log_cmd_error("getcwd failed: %s\n", strerror(errno));
+ log_abort();
+ }
for (argidx = 1; argidx < args.size(); argidx++) {
std::string arg = args[argidx];
if (arg == "-exe" && argidx+1 < args.size()) {
@@ -1020,7 +1026,6 @@ struct AbcPass : public Pass {
}
break;
}
- free(pwd);
extra_args(args, argidx, design);
if (lut_mode != 0 && !liberty_file.empty())