From 7ad4fda5499e6df3a7eb2eb0504a4f4944179b6d Mon Sep 17 00:00:00 2001 From: Andrea Mattavelli Date: Mon, 8 Aug 2016 09:36:22 +0100 Subject: Use LLVM-based functions to print errno --- tools/klee/main.cpp | 9 +++------ 1 file 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); -- cgit 1.4.1