OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/ipc_channel_posix.h" | 5 #include "ipc/ipc_channel_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 if (bytes_read < 0) { | 440 if (bytes_read < 0) { |
441 if (errno == EAGAIN) { | 441 if (errno == EAGAIN) { |
442 return true; | 442 return true; |
443 #if defined(OS_MACOSX) | 443 #if defined(OS_MACOSX) |
444 } else if (errno == EPERM) { | 444 } else if (errno == EPERM) { |
445 // On OSX, reading from a pipe with no listener returns EPERM | 445 // On OSX, reading from a pipe with no listener returns EPERM |
446 // treat this as a special case to prevent spurious error messages | 446 // treat this as a special case to prevent spurious error messages |
447 // to the console. | 447 // to the console. |
448 return false; | 448 return false; |
449 #endif // defined(OS_MACOSX) | 449 #endif // defined(OS_MACOSX) |
| 450 } else if (errno == ECONNRESET) { |
| 451 return false; |
450 } else { | 452 } else { |
451 PLOG(ERROR) << "pipe error (" << pipe_ << ")"; | 453 PLOG(ERROR) << "pipe error (" << pipe_ << ")"; |
452 return false; | 454 return false; |
453 } | 455 } |
454 } else if (bytes_read == 0) { | 456 } else if (bytes_read == 0) { |
455 // The pipe has closed... | 457 // The pipe has closed... |
456 Close(); | 458 Close(); |
457 return false; | 459 return false; |
458 } | 460 } |
459 } | 461 } |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1007 |
1006 bool Channel::Send(Message* message) { | 1008 bool Channel::Send(Message* message) { |
1007 return channel_impl_->Send(message); | 1009 return channel_impl_->Send(message); |
1008 } | 1010 } |
1009 | 1011 |
1010 int Channel::GetClientFileDescriptor() const { | 1012 int Channel::GetClientFileDescriptor() const { |
1011 return channel_impl_->GetClientFileDescriptor(); | 1013 return channel_impl_->GetClientFileDescriptor(); |
1012 } | 1014 } |
1013 | 1015 |
1014 } // namespace IPC | 1016 } // namespace IPC |
OLD | NEW |