Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5b85a43 authored by Dima Zavin's avatar Dima Zavin
Browse files

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: default avatarDima Zavin <dmitriyz@waymo.com>
parent 949a561c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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");