From 8c43332f53b9559280d949bbe02e1a6bcb0911c5 Mon Sep 17 00:00:00 2001 From: "Koska, Andrzej" Date: Mon, 10 Sep 2018 16:30:37 +0200 Subject: [PATCH] Temporary WA for getcwd This reverts commit df6cd7e7d8663cd5382a7c3aafcd8f4cce19c319. Change-Id: I360c44ebaef5d74368ee63cb4d98858e646238bf --- unit_tests/offline_compiler/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/unit_tests/offline_compiler/main.cpp b/unit_tests/offline_compiler/main.cpp index 3b6343a8e7..4c6596e4d2 100644 --- a/unit_tests/offline_compiler/main.cpp +++ b/unit_tests/offline_compiler/main.cpp @@ -32,6 +32,7 @@ const char *fSeparator = "\\"; #elif defined(__linux__) const char *fSeparator = "/"; #endif +std::string cwd; Environment *gEnvironment; @@ -42,13 +43,19 @@ std::string getRunPath() { #if defined(__linux__) res = getcwd(nullptr, 0); #else - res = _getcwd(nullptr, 0); + res = cwd; #endif return res; } int main(int argc, char **argv) { int retVal = 0; + std::string execPath(argv[0]); + char separator = '/'; + if (execPath.find_last_of("\\") != std::string::npos) + separator = '\\'; + cwd = execPath.substr(0, execPath.find_last_of(separator)); + bool useDefaultListener = false; std::string devicePrefix("skl"); std::string familyNameWithType("Gen9core");