diff options
author | Matt Morehouse <mascasa@google.com> | 2018-04-06 18:15:24 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-04-06 18:15:24 +0000 |
commit | 97a855a7cd77407a90aafb7d518ee13be2b6e642 (patch) | |
tree | c29a3938b77eae10deb1a510dbb339c2dc5e3515 /compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp | |
parent | 92f9cd228e30e04a54aeba571d4f7d6b8915f6e4 (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
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp b/compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp index 2257751c662..17e884d3c4c 100644 --- a/compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp +++ b/compiler-rt/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)) { |