From 706b4fc47bbc608932d3b491ae19a3b9cde9497b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Jan 2020 20:45:01 +0000 Subject: Vendor import of llvm-project master e26a78e70, the last commit before the llvmorg-11-init tag, from which release/10.x was branched. --- compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp') diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp index 171db23570c4..d449bc248f09 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp @@ -17,6 +17,7 @@ #include #include #include +#include // There is no header for this on macOS so declare here extern "C" char **environ; @@ -156,6 +157,14 @@ int ExecuteCommand(const Command &Cmd) { return ProcessStatus; } +void DiscardOutput(int Fd) { + FILE* Temp = fopen("/dev/null", "w"); + if (!Temp) + return; + dup2(fileno(Temp), Fd); + fclose(Temp); +} + } // namespace fuzzer #endif // LIBFUZZER_APPLE -- cgit v1.2.3