diff options
author | Kostya Serebryany <kcc@google.com> | 2016-02-02 03:03:47 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-02-02 03:03:47 +0000 |
commit | bfbe7fc4044dc6d96b52ba41c38437e0905ab1b9 (patch) | |
tree | ec31822f26537c0903669f65aa5e4720ac328141 /llvm/lib/Fuzzer/FuzzerIO.cpp | |
parent | 74937fcd0059a159871eaf6f194bde0ef0523475 (diff) | |
download | llvm-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.cpp | 7 |
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)) |