summaryrefslogtreecommitdiff
path: root/runtime/exec_utils.h
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2022-07-07 20:36:59 +0000
committer Jiakai Zhang <jiakaiz@google.com> 2022-07-11 12:23:56 +0000
commita9f772730fb493c5c3fa412fc0b91f2e9b8dbe17 (patch)
tree85cf686a26e365a567c1e4af883eec0b68b897ed /runtime/exec_utils.h
parenta968731b013c39d33c92a447cce98ba871cd1c01 (diff)
Revert^2 "Update ExecUtils to support artd use cases."
This reverts commit ff95ad517297384d4a2ea589490019f90d637e17. Reason for revert: Fix available (aosp/2148047) Test: Presubmit Change-Id: I952960949267a7b6e63cd7966a347cb1f3374b85 Merged-In: I375034162cded6fdf09ee4d4cd783a0d3987af49
Diffstat (limited to 'runtime/exec_utils.h')
-rw-r--r--runtime/exec_utils.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/exec_utils.h b/runtime/exec_utils.h
index 7ce0a9c20a..ff90ebdfb3 100644
--- a/runtime/exec_utils.h
+++ b/runtime/exec_utils.h
@@ -29,13 +29,13 @@ namespace art {
// of the runtime (Runtime::Current()) was started. If no instance of the runtime was started, it
// will use the current environment settings.
-bool Exec(std::vector<std::string>& arg_vector, /*out*/ std::string* error_msg);
-int ExecAndReturnCode(std::vector<std::string>& arg_vector, /*out*/ std::string* error_msg);
+bool Exec(const std::vector<std::string>& arg_vector, /*out*/ std::string* error_msg);
+int ExecAndReturnCode(const std::vector<std::string>& arg_vector, /*out*/ std::string* error_msg);
// Execute the command specified in `argv_vector` in a subprocess with a timeout.
// Returns the process exit code on success, -1 otherwise.
-int ExecAndReturnCode(std::vector<std::string>& arg_vector,
- time_t timeout_secs,
+int ExecAndReturnCode(const std::vector<std::string>& arg_vector,
+ int timeout_sec,
/*out*/ bool* timed_out,
/*out*/ std::string* error_msg);
@@ -44,20 +44,21 @@ class ExecUtils {
public:
virtual ~ExecUtils() = default;
- virtual bool Exec(std::vector<std::string>& arg_vector, /*out*/ std::string* error_msg) const {
+ virtual bool Exec(const std::vector<std::string>& arg_vector,
+ /*out*/ std::string* error_msg) const {
return art::Exec(arg_vector, error_msg);
}
- virtual int ExecAndReturnCode(std::vector<std::string>& arg_vector,
+ virtual int ExecAndReturnCode(const std::vector<std::string>& arg_vector,
/*out*/ std::string* error_msg) const {
return art::ExecAndReturnCode(arg_vector, error_msg);
}
- virtual int ExecAndReturnCode(std::vector<std::string>& arg_vector,
- time_t timeout_secs,
+ virtual int ExecAndReturnCode(const std::vector<std::string>& arg_vector,
+ int timeout_sec,
/*out*/ bool* timed_out,
/*out*/ std::string* error_msg) const {
- return art::ExecAndReturnCode(arg_vector, timeout_secs, timed_out, error_msg);
+ return art::ExecAndReturnCode(arg_vector, timeout_sec, timed_out, error_msg);
}
};