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

Commit db09e4b3 authored by Andy Hung's avatar Andy Hung
Browse files

nblog: fix loop condition on getSnapshot

Prevents unbounded looping

Test: treehugger
Bug: 340387001
Change-Id: Ie6e42342862285365691aa4225c1b07802a71b93
parent fce78599
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ std::unique_ptr<Snapshot> Reader::getSnapshot(bool flush)
    do {
        availToRead = mFifoReader->obtain(iovec, capacity, NULL /*timeout*/, &lostTemp);
        lost += lostTemp;
    } while (availToRead < 0 || ++tries <= kMaxObtainTries);
    } while (availToRead < 0 && ++tries <= kMaxObtainTries);

    if (availToRead <= 0) {
        ALOGW_IF(availToRead < 0, "NBLog Reader %s failed to catch up with Writer", mName.c_str());