summaryrefslogtreecommitdiff
path: root/lib/fuzzer/FuzzerIO.cpp
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2018-08-28 19:07:24 +0000
committerMatt Morehouse <mascasa@google.com>2018-08-28 19:07:24 +0000
commitdfdafdfd47764a9728726abd45f99ac9faca81e5 (patch)
treed8ef880c63fe3dfa238ff16026da431328ac7e25 /lib/fuzzer/FuzzerIO.cpp
parent5ca960adad7c824b1ee5567271beb4b29abe9a3d (diff)
downloadcompiler-rt-dfdafdfd47764a9728726abd45f99ac9faca81e5.tar.gz
Revert "[libFuzzer] Port to Windows"
This reverts commit r340860 due to failing tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerIO.cpp')
-rw-r--r--lib/fuzzer/FuzzerIO.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/fuzzer/FuzzerIO.cpp b/lib/fuzzer/FuzzerIO.cpp
index dac5ec658..f3ead0ec5 100644
--- a/lib/fuzzer/FuzzerIO.cpp
+++ b/lib/fuzzer/FuzzerIO.cpp
@@ -100,6 +100,14 @@ std::string DirPlusFile(const std::string &DirPath,
return DirPath + GetSeparator() + FileName;
}
+std::string Basename(const std::string &Path, char Separator) {
+ size_t Pos = Path.rfind(Separator);
+ if (Pos == std::string::npos)
+ return Path;
+ assert(Pos < Path.size());
+ return Path.substr(Pos + 1);
+}
+
void DupAndCloseStderr() {
int OutputFd = DuplicateFile(2);
if (OutputFd > 0) {