| Index: mojo/system/raw_channel_posix.cc
|
| diff --git a/mojo/system/raw_channel_posix.cc b/mojo/system/raw_channel_posix.cc
|
| index 88638883b2318c7813c4526fbaf3bbfcc6129f5f..469f5398ab2eaeaf252175fe3d7f188db88fa392 100644
|
| --- a/mojo/system/raw_channel_posix.cc
|
| +++ b/mojo/system/raw_channel_posix.cc
|
| @@ -211,14 +211,18 @@ RawChannel::IOResult RawChannelPosix::Read(size_t* bytes_read) {
|
| return IO_FAILED_SHUTDOWN;
|
| }
|
|
|
| - if (errno != EAGAIN && errno != EWOULDBLOCK) {
|
| + if (errno == EAGAIN || errno == EWOULDBLOCK)
|
| + return ScheduleRead();
|
| +
|
| + IOResult rv = IO_FAILED_UNKNOWN;
|
| + if (errno == ECONNRESET)
|
| + rv = IO_FAILED_BROKEN;
|
| + else
|
| PLOG(WARNING) << "recvmsg";
|
| - // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again.
|
| - read_watcher_.reset();
|
| - return IO_FAILED_UNKNOWN;
|
| - }
|
|
|
| - return ScheduleRead();
|
| + // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again.
|
| + read_watcher_.reset();
|
| + return rv;
|
| }
|
|
|
| RawChannel::IOResult RawChannelPosix::ScheduleRead() {
|
|
|