summaryrefslogtreecommitdiffstats
path: root/fastboot/fastboot_driver.cpp
diff options
context:
space:
mode:
authorDima Zavin <dmitriyz@waymo.com>2019-02-28 14:50:25 -0800
committerDima Zavin <dmitriyz@waymo.com>2019-02-28 14:55:48 -0800
commita5b85a431ef7ba701a309aed1a4ea763922b42cd (patch)
tree2d42f6af5aa1f30580b79149460526758131c39f /fastboot/fastboot_driver.cpp
parent949a561cfaf96840101901c6c9448dd3e859a4bd (diff)
downloadsystem_core-a5b85a431ef7ba701a309aed1a4ea763922b42cd.tar.gz
system_core-a5b85a431ef7ba701a309aed1a4ea763922b42cd.tar.bz2
system_core-a5b85a431ef7ba701a309aed1a4ea763922b42cd.zip
fastboot: switch the timeout clock source to steady_clock
Previously, system_clock was used for remote command timeouts which can get disturbed by NTP adjustments (jumps). Change-Id: I0ffc159bf34d12e8d3713044524114d60a6a45ca Signed-off-by: Dima Zavin <dmitriyz@waymo.com>
Diffstat (limited to 'fastboot/fastboot_driver.cpp')
-rw-r--r--fastboot/fastboot_driver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fastboot/fastboot_driver.cpp b/fastboot/fastboot_driver.cpp
index 65a52475d..4deed94a0 100644
--- a/fastboot/fastboot_driver.cpp
+++ b/fastboot/fastboot_driver.cpp
@@ -403,7 +403,7 @@ RetCode FastBootDriver::DownloadCommand(uint32_t size, std::string* response,
RetCode FastBootDriver::HandleResponse(std::string* response, std::vector<std::string>* info,
int* dsize) {
char status[FB_RESPONSE_SZ + 1];
- auto start = std::chrono::system_clock::now();
+ auto start = std::chrono::steady_clock::now();
auto set_response = [response](std::string s) {
if (response) *response = std::move(s);
@@ -414,7 +414,7 @@ RetCode FastBootDriver::HandleResponse(std::string* response, std::vector<std::s
// erase response
set_response("");
- while ((std::chrono::system_clock::now() - start) < std::chrono::seconds(RESP_TIMEOUT)) {
+ while ((std::chrono::steady_clock::now() - start) < std::chrono::seconds(RESP_TIMEOUT)) {
int r = transport_->Read(status, FB_RESPONSE_SZ);
if (r < 0) {
error_ = ErrnoStr("Status read failed");