[libFuzzer] extend the -fork=1 functionality. Still not fully usable, but good enough for the first unit test
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer@353775 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/FuzzerIO.cpp b/FuzzerIO.cpp
index 1ff2293..a18fba7 100644
--- a/FuzzerIO.cpp
+++ b/FuzzerIO.cpp
@@ -125,4 +125,11 @@
fflush(OutputFile);
}
+void RmFilesInDir(const std::string &Path) {
+ Vector<std::string> Files;
+ ListFilesInDirRecursive(Path, 0, &Files, /*TopDir*/true);
+ for (auto &F : Files)
+ RemoveFile(F);
+}
+
} // namespace fuzzer