зеркало из https://github.com/mozilla/pjs.git
Bug 739121: Nonblocking IO handling error in RIL.cpp, r=qdot
This commit is contained in:
Родитель
ac2fa7e286
Коммит
cfaab10c4a
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче