diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-05-26 18:02:46 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-05-26 18:02:46 +0300 |
commit | d85fbebd3ea97ba43da1f6d672dde2b18347f11a (patch) | |
tree | 592f624cde6617872108479e43b781b2e16b565c /contrib/libs/libfuzzer/FuzzerUtilLinux.cpp | |
parent | d8341f8abab29d0fcfb7096a3d1b3c6fd399781b (diff) | |
download | ydb-d85fbebd3ea97ba43da1f6d672dde2b18347f11a.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/libs/libfuzzer/FuzzerUtilLinux.cpp')
-rw-r--r-- | contrib/libs/libfuzzer/FuzzerUtilLinux.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/contrib/libs/libfuzzer/FuzzerUtilLinux.cpp b/contrib/libs/libfuzzer/FuzzerUtilLinux.cpp deleted file mode 100644 index 981f9a8b429..00000000000 --- a/contrib/libs/libfuzzer/FuzzerUtilLinux.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===- FuzzerUtilLinux.cpp - Misc utils for Linux. ------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// Misc utils for Linux. -//===----------------------------------------------------------------------===// -#include "FuzzerPlatform.h" -#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD || \ - LIBFUZZER_EMSCRIPTEN -#include "FuzzerCommand.h" - -#include <stdlib.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <unistd.h> - - -namespace fuzzer { - -int ExecuteCommand(const Command &Cmd) { - std::string CmdLine = Cmd.toString(); - int exit_code = system(CmdLine.c_str()); - if (WIFEXITED(exit_code)) - return WEXITSTATUS(exit_code); - return exit_code; -} - -void DiscardOutput(int Fd) { - FILE* Temp = fopen("/dev/null", "w"); - if (!Temp) - return; - dup2(fileno(Temp), Fd); - fclose(Temp); -} - -} // namespace fuzzer - -#endif |