mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 739121: Nonblocking IO handling error in RIL.cpp, r=qdot
This commit is contained in:
parent
67ee95d3b8
commit
218ff032bd
@ -278,6 +278,15 @@ RilClient::OnFileCanReadWithoutBlocking(int fd)
|
||||
mIncoming = new RilRawData();
|
||||
ssize_t ret = read(fd, mIncoming->mData, RilRawData::MAX_DATA_SIZE);
|
||||
if (ret <= 0) {
|
||||
if (ret == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue; // retry system call when interrupted
|
||||
}
|
||||
else if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
return; // no data available: return and re-poll
|
||||
}
|
||||
// else fall through to error handling on other errno's
|
||||
}
|
||||
LOG("Cannot read from network, error %d\n", ret);
|
||||
// At this point, assume that we can't actually access
|
||||
// the socket anymore, and start a reconnect loop.
|
||||
|
Loading…
Reference in New Issue
Block a user