From 1822be8792865e3f6f0765693f93b8e85fcb279f Mon Sep 17 00:00:00 2001 From: "Mohamed A. Bamakhrama" Date: Mon, 23 May 2022 22:21:45 +0200 Subject: Observe $TMPDIR variable when creating tmp files POSIX defines $TMPDIR as containing the pathname of the directory where programs can create temporary files. On most systems, this variable points to "/tmp". However, on some systems it can point to a different location. Without respecting this variable, yosys fails to run on such systems. Signed-off-by: Mohamed A. Bamakhrama --- kernel/fstdata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/fstdata.cc') diff --git a/kernel/fstdata.cc b/kernel/fstdata.cc index fea8ee3c3..b2e574b02 100644 --- a/kernel/fstdata.cc +++ b/kernel/fstdata.cc @@ -33,7 +33,7 @@ FstData::FstData(std::string filename) : ctx(nullptr) std::string filename_trim = file_base_name(filename); if (filename_trim.size() > 4 && filename_trim.compare(filename_trim.size()-4, std::string::npos, ".vcd") == 0) { filename_trim.erase(filename_trim.size()-4); - tmp_file = stringf("/tmp/converted_%s.fst", filename_trim.c_str()); + tmp_file = stringf("%s/converted_%s.fst", get_base_tmpdir().c_str(), filename_trim.c_str()); std::string cmd = stringf("vcd2fst %s %s", filename.c_str(), tmp_file.c_str()); log("Exec: %s\n", cmd.c_str()); if (run_command(cmd) != 0) -- cgit v1.2.3