about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorAndrea Mattavelli <andreamattavelli@gmail.com>2016-08-08 09:36:22 +0100
committerAndrea Mattavelli <andreamattavelli@gmail.com>2016-08-08 09:36:22 +0100
commit7ad4fda5499e6df3a7eb2eb0504a4f4944179b6d (patch)
treecf4c691a92d377e770ed181dbdf003d0869a90de
parent171c119b48f67171b9cba1091bc58cb61edddd5b (diff)
downloadklee-7ad4fda5499e6df3a7eb2eb0504a4f4944179b6d.tar.gz
Use LLVM-based functions to print errno
-rw-r--r--tools/klee/main.cpp9
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);