summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2018-04-06 18:15:24 +0000
committerMatt Morehouse <mascasa@google.com>2018-04-06 18:15:24 +0000
commit5e41b2de58812e793f0d03c0aa16126522888338 (patch)
treea23e239ef00bf0974ae1cb9228af4534ddb07d9a /lib
parentc2b537fb5591fbd43de3c406f8871a7ece5b494f (diff)
[libFuzzer] Print a correct error message when a directory can't be
opened. Summary: Currently if the directory cannot be opened for a reason other than non-existence (e.g. too many open file descriptors) the error message printed is incredibly confusing. Patch By: Alex Gaynor Reviewers: kcc, morehouse Reviewed By: morehouse Subscribers: delcypher, llvm-commits, Sanitizers Differential Revision: https://reviews.llvm.org/D45322 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/fuzzer/FuzzerIOPosix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fuzzer/FuzzerIOPosix.cpp b/lib/fuzzer/FuzzerIOPosix.cpp
index 2257751c6..17e884d3c 100644
--- a/lib/fuzzer/FuzzerIOPosix.cpp
+++ b/lib/fuzzer/FuzzerIOPosix.cpp
@@ -54,7 +54,7 @@ void ListFilesInDirRecursive(const std::string &Dir, long *Epoch,
DIR *D = opendir(Dir.c_str());
if (!D) {
- Printf("No such directory: %s; exiting\n", Dir.c_str());
+ Printf("%s: %s; exiting\n", strerror(errno), Dir.c_str());
exit(1);
}
while (auto E = readdir(D)) {