diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-10-17 14:01:47 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-17 14:01:47 +0200 |
commit | 468ae923748a01b2763bafa3cf5fba883fe06479 (patch) | |
tree | f80cf488e9a2f07592c2444b853d0c53edce7a20 /kernel/yosys.cc | |
parent | 973d37673377c3ddba8020e718e4cd6174379175 (diff) |
Various win32 / vs build fixes
Diffstat (limited to 'kernel/yosys.cc')
-rw-r--r-- | kernel/yosys.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index ed90a6f3..26665e5b 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -269,12 +269,12 @@ std::string make_temp_dir(std::string template_str) #ifdef _WIN32 bool check_file_exists(std::string filename, bool) { - return _access(filename.c_str(), 0); + return _access(filename.c_str(), 0) == 0; } #else bool check_file_exists(std::string filename, bool is_exec) { - return access(filename.c_str(), is_exec ? X_OK : F_OK); + return access(filename.c_str(), is_exec ? X_OK : F_OK) == 0; } #endif @@ -497,10 +497,10 @@ std::string proc_share_dirname() { std::string proc_self_path = proc_self_dirname(); std::string proc_share_path = proc_self_path + "share/"; - if (check_file_exists(proc_share_path, true) == 0) + if (check_file_exists(proc_share_path, true)) return proc_share_path; proc_share_path = proc_self_path + "../share/yosys/"; - if (check_file_exists(proc_share_path, true) == 0) + if (check_file_exists(proc_share_path, true)) return proc_share_path; log_error("proc_share_dirname: unable to determine share/ directory!\n"); } |