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

Commit 3ad3807a authored by Mathias Agopian's avatar Mathias Agopian
Browse files

BitTube::read now handles EAGAIN

Change-Id: Iacda2386342ba0727bbf278f6c597488d5467bb8
parent 41f673c9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -97,6 +97,11 @@ ssize_t BitTube::read(void* vaddr, size_t size)
        len = ::read(mReceiveFd, vaddr, size);
        err = len < 0 ? errno : 0;
    } while (err == EINTR);
    if (err == EAGAIN || err == EWOULDBLOCK) {
        // EAGAIN means that we have non-blocking I/O but there was
        // no data to be read. Nothing the client should care about.
        return 0;
    }
    return err == 0 ? len : -err;
}