about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2016-06-24 18:18:23 +0100
committerGitHub <noreply@github.com>2016-06-24 18:18:23 +0100
commita49c6fabebb91718b54489e7c09cb7bddc9795b2 (patch)
tree1466f9d605c45563c951030d4c6a22feaf689103 /tools
parent96c244cda990edeb435a750fdef050b95c38ac7d (diff)
parent96cbd7f7dfa69f47ae08c0bb833fde167c5af909 (diff)
downloadklee-a49c6fabebb91718b54489e7c09cb7bddc9795b2.tar.gz
Merge pull request #394 from andreamattavelli/refactoring_runindir
Added error message for -run-in directory errors
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 7fe64c72..de04d92e 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1430,7 +1430,10 @@ int main(int argc, char **argv, char **envp) {
     if (RunInDir != "") {
       int res = chdir(RunInDir.c_str());
       if (res < 0) {
-        klee_error("Unable to change directory to: %s", RunInDir.c_str());
+        char info[128];
+        char *str = strerror_r(errno, info, sizeof(info));
+        klee_error("Unable to change directory to: %s - %s", RunInDir.c_str(),
+                   str);
       }
     }
 
@@ -1492,7 +1495,10 @@ int main(int argc, char **argv, char **envp) {
     if (RunInDir != "") {
       int res = chdir(RunInDir.c_str());
       if (res < 0) {
-        klee_error("Unable to change directory to: %s", RunInDir.c_str());
+        char info[128];
+        char *str = strerror_r(errno, info, sizeof(info));
+        klee_error("Unable to change directory to: %s - %s", RunInDir.c_str(),
+                   str);
       }
     }
     interpreter->runFunctionAsMain(mainFn, pArgc, pArgv, pEnvp);