diff options
author | Mathias Agopian <mathias@google.com> | 2011-11-29 11:42:32 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-11-29 11:42:59 -0800 |
commit | 3ad3807a5c4039618175c042a1121c926c2c62e9 (patch) | |
tree | 4bb0ef79b971d22d0b353cad06df1afa204f4cee /libs/gui | |
parent | 41f673c9b3aac0d96e41c928845c39186d565212 (diff) | |
download | frameworks_native-3ad3807a5c4039618175c042a1121c926c2c62e9.zip frameworks_native-3ad3807a5c4039618175c042a1121c926c2c62e9.tar.gz frameworks_native-3ad3807a5c4039618175c042a1121c926c2c62e9.tar.bz2 |
BitTube::read now handles EAGAIN
Change-Id: Iacda2386342ba0727bbf278f6c597488d5467bb8
Diffstat (limited to 'libs/gui')
-rw-r--r-- | libs/gui/BitTube.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp index c632b43..fa8d0ea 100644 --- a/libs/gui/BitTube.cpp +++ b/libs/gui/BitTube.cpp @@ -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; } |