summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Android/AdbClient.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-11-25 12:22:32 +0000
committerPavel Labath <labath@google.com>2016-11-25 12:22:32 +0000
commit2f159a5f93250706ad5bed6c2e8521ead4df749f (patch)
tree3051d9521e10342ae738046f79528a9054974091 /lldb/source/Plugins/Platform/Android/AdbClient.cpp
parent3043fd8ff087b1b577e363f33bbc1b6e1e8d5cdc (diff)
downloadbcm5719-llvm-2f159a5f93250706ad5bed6c2e8521ead4df749f.tar.gz
bcm5719-llvm-2f159a5f93250706ad5bed6c2e8521ead4df749f.zip
Introduce Chrono to the Connection class. NFCI.
llvm-svn: 287922
Diffstat (limited to 'lldb/source/Plugins/Platform/Android/AdbClient.cpp')
-rw-r--r--lldb/source/Plugins/Platform/Android/AdbClient.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
index 05004406c04..eb684ad0fbc 100644
--- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp
+++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
@@ -74,10 +74,9 @@ Error ReadAllBytes(Connection &conn, void *buffer, size_t size) {
const auto deadline = now + kReadTimeout;
size_t total_read_bytes = 0;
while (total_read_bytes < size && now < deadline) {
- uint32_t timeout_usec = duration_cast<microseconds>(deadline - now).count();
auto read_bytes =
conn.Read(read_buffer + total_read_bytes, size - total_read_bytes,
- timeout_usec, status, &error);
+ duration_cast<microseconds>(deadline - now), status, &error);
if (error.Fail())
return error;
total_read_bytes += read_bytes;
@@ -276,9 +275,9 @@ Error AdbClient::ReadMessageStream(std::vector<char> &message,
if (elapsed >= timeout)
return Error("Timed out");
- size_t n = m_conn->Read(
- buffer, sizeof(buffer),
- duration_cast<microseconds>(timeout - elapsed).count(), status, &error);
+ size_t n = m_conn->Read(buffer, sizeof(buffer),
+ duration_cast<microseconds>(timeout - elapsed),
+ status, &error);
if (n > 0)
message.insert(message.end(), &buffer[0], &buffer[n]);
}
OpenPOWER on IntegriCloud