diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2016-08-08 10:50:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 10:50:15 +0100 |
commit | df62e30a8883f3c146700f3666442c7ada42ba3c (patch) | |
tree | cf4c691a92d377e770ed181dbdf003d0869a90de | |
parent | 171c119b48f67171b9cba1091bc58cb61edddd5b (diff) | |
parent | 7ad4fda5499e6df3a7eb2eb0504a4f4944179b6d (diff) | |
download | klee-df62e30a8883f3c146700f3666442c7ada42ba3c.tar.gz |
Merge pull request #450 from andreamattavelli/fix_to_strerror
Fix to #449 by using sys::StrError(errno) to print error messages.
-rw-r--r-- | tools/klee/main.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index de04d92e..3e469a6e 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -40,6 +40,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Support/FileSystem.h" #endif +#include "llvm/Support/Errno.h" #include "llvm/Support/FileSystem.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Support/CommandLine.h" @@ -1430,10 +1431,8 @@ int main(int argc, char **argv, char **envp) { if (RunInDir != "") { int res = chdir(RunInDir.c_str()); if (res < 0) { - char info[128]; - char *str = strerror_r(errno, info, sizeof(info)); klee_error("Unable to change directory to: %s - %s", RunInDir.c_str(), - str); + sys::StrError(errno).c_str()); } } @@ -1495,10 +1494,8 @@ int main(int argc, char **argv, char **envp) { if (RunInDir != "") { int res = chdir(RunInDir.c_str()); if (res < 0) { - char info[128]; - char *str = strerror_r(errno, info, sizeof(info)); klee_error("Unable to change directory to: %s - %s", RunInDir.c_str(), - str); + sys::StrError(errno).c_str()); } } interpreter->runFunctionAsMain(mainFn, pArgc, pArgv, pEnvp); |