diff options
author | Matt Morehouse <mascasa@google.com> | 2017-12-04 19:25:59 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2017-12-04 19:25:59 +0000 |
commit | 04304d129bbc6a63a7ff2051003e40ec9edbcb0f (patch) | |
tree | bee68f141877af7be7491074065b260c0292739d /compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp | |
parent | adf37517304a3a661a033c785cb6b502539db486 (diff) | |
download | bcm5719-llvm-04304d129bbc6a63a7ff2051003e40ec9edbcb0f.tar.gz bcm5719-llvm-04304d129bbc6a63a7ff2051003e40ec9edbcb0f.zip |
[libFuzzer] Encapsulate commands in a class.
Summary:
To be more portable (especially w.r.t. platforms without system()),
commands should be managed programmatically rather than via string
manipulation on the command line. This change introduces
Fuzzer::Command, with methods to manage arguments and flags, set output
options, and execute the command.
Patch By: aarongreen
Reviewers: kcc, morehouse
Reviewed By: kcc, morehouse
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D40103
llvm-svn: 319680
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp index 69d46b578c0..c7cf2c0a778 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp @@ -10,13 +10,15 @@ //===----------------------------------------------------------------------===// #include "FuzzerDefs.h" #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD +#include "FuzzerCommand.h" #include <stdlib.h> namespace fuzzer { -int ExecuteCommand(const std::string &Command) { - return system(Command.c_str()); +int ExecuteCommand(const Command &Cmd) { + std::string CmdLine = Cmd.toString(); + return system(CmdLine.c_str()); } } // namespace fuzzer |