summaryrefslogtreecommitdiff
path: root/lib/fuzzer/FuzzerUtilLinux.cpp
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2017-12-04 19:25:59 +0000
committerMatt Morehouse <mascasa@google.com>2017-12-04 19:25:59 +0000
commitc9d933986ac9833fc9929999b669818be6e60053 (patch)
tree19cd2f04acbe4c2623fd009a89903ac769a291c2 /lib/fuzzer/FuzzerUtilLinux.cpp
parent2217d9faa962b3bee8704fbfae796fe342613266 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerUtilLinux.cpp')
-rw-r--r--lib/fuzzer/FuzzerUtilLinux.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/fuzzer/FuzzerUtilLinux.cpp b/lib/fuzzer/FuzzerUtilLinux.cpp
index 69d46b578..c7cf2c0a7 100644
--- a/lib/fuzzer/FuzzerUtilLinux.cpp
+++ b/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