summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp/jdwp_main.cc
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-19 11:24:52 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-19 11:24:52 -0700
commitd35311bcf4da508aefda65e6328cd18b878cb094 (patch)
tree5ea26227a61f1ce4a5d9d4dfda4da31fee012906 /runtime/jdwp/jdwp_main.cc
parentd0e4e9eea233a55856df726c98ecc7aaca7f826c (diff)
parentf52935278fca8c7aa220543eef4544e3d1105d91 (diff)
downloadart-d35311bcf4da508aefda65e6328cd18b878cb094.zip
art-d35311bcf4da508aefda65e6328cd18b878cb094.tar.gz
art-d35311bcf4da508aefda65e6328cd18b878cb094.tar.bz2
am f5293527: Move JDWP to std::vector<iovec> to remove runtime/arrays warning
* commit 'f52935278fca8c7aa220543eef4544e3d1105d91': Move JDWP to std::vector<iovec> to remove runtime/arrays warning
Diffstat (limited to 'runtime/jdwp/jdwp_main.cc')
-rw-r--r--runtime/jdwp/jdwp_main.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc
index 8e61d23..93deee5 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -132,16 +132,16 @@ ssize_t JdwpNetStateBase::WritePacket(ExpandBuf* pReply) {
/*
* Write a buffered packet. Grabs a mutex to assure atomicity.
*/
-ssize_t JdwpNetStateBase::WriteBufferedPacket(const iovec* iov, int iov_count) {
+ssize_t JdwpNetStateBase::WriteBufferedPacket(const std::vector<iovec>& iov) {
MutexLock mu(Thread::Current(), socket_lock_);
- return TEMP_FAILURE_RETRY(writev(clientSock, iov, iov_count));
+ return TEMP_FAILURE_RETRY(writev(clientSock, &iov[0], iov.size()));
}
bool JdwpState::IsConnected() {
return netState != NULL && netState->IsConnected();
}
-void JdwpState::SendBufferedRequest(uint32_t type, const iovec* iov, int iov_count) {
+void JdwpState::SendBufferedRequest(uint32_t type, const std::vector<iovec>& iov) {
if (netState->clientSock < 0) {
// Can happen with some DDMS events.
VLOG(jdwp) << "Not sending JDWP packet: no debugger attached!";
@@ -149,12 +149,12 @@ void JdwpState::SendBufferedRequest(uint32_t type, const iovec* iov, int iov_cou
}
size_t expected = 0;
- for (int i = 0; i < iov_count; ++i) {
+ for (size_t i = 0; i < iov.size(); ++i) {
expected += iov[i].iov_len;
}
errno = 0;
- ssize_t actual = netState->WriteBufferedPacket(iov, iov_count);
+ ssize_t actual = netState->WriteBufferedPacket(iov);
if (static_cast<size_t>(actual) != expected) {
PLOG(ERROR) << StringPrintf("Failed to send JDWP packet %c%c%c%c to debugger (%d of %d)",
static_cast<uint8_t>(type >> 24),