aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerIO.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-02-02 03:03:47 +0000
committerKostya Serebryany <kcc@google.com>2016-02-02 03:03:47 +0000
commitbfbe7fc4044dc6d96b52ba41c38437e0905ab1b9 (patch)
treeec31822f26537c0903669f65aa5e4720ac328141 /llvm/lib/Fuzzer/FuzzerIO.cpp
parent74937fcd0059a159871eaf6f194bde0ef0523475 (diff)
downloadllvm-bfbe7fc4044dc6d96b52ba41c38437e0905ab1b9.zip
llvm-bfbe7fc4044dc6d96b52ba41c38437e0905ab1b9.tar.gz
llvm-bfbe7fc4044dc6d96b52ba41c38437e0905ab1b9.tar.bz2
[libFuzzer] allow passing 1 or more files as individual inputs
llvm-svn: 259459
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerIO.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index cc65876..9df6837 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -20,6 +20,13 @@
namespace fuzzer {
+bool IsFile(const std::string &Path) {
+ struct stat St;
+ if (stat(Path.c_str(), &St))
+ return false;
+ return S_ISREG(St.st_mode);
+}
+
static long GetEpoch(const std::string &Path) {
struct stat St;
if (stat(Path.c_str(), &St))