| Index: runtime/bin/eventhandler_macos.cc
|
| diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
|
| index b0e29507c82bca2ac65d973c6b81aa2e24c50179..b2c2c9b039c6167f7cb6668a5993453958a2e04a 100644
|
| --- a/runtime/bin/eventhandler_macos.cc
|
| +++ b/runtime/bin/eventhandler_macos.cc
|
| @@ -266,7 +266,8 @@ intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) {
|
| }
|
| }
|
|
|
| - // On pipes POLLHUP is reported without POLLIN.
|
| + // On pipes POLLHUP is reported without POLLIN when there is no
|
| + // more data to read.
|
| if (sd->IsPipe()) {
|
| if (((pollfd->revents & POLLIN) == 0) &&
|
| ((pollfd->revents & POLLHUP) != 0)) {
|
| @@ -275,7 +276,14 @@ intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) {
|
| }
|
| }
|
|
|
| - if ((pollfd->revents & POLLOUT) != 0) event_mask |= (1 << kOutEvent);
|
| + if ((pollfd->revents & POLLOUT) != 0) {
|
| + if ((pollfd->revents & POLLERR) != 0) {
|
| + event_mask = (1 << kErrorEvent);
|
| + sd->MarkClosedWrite();
|
| + } else {
|
| + event_mask |= (1 << kOutEvent);
|
| + }
|
| + }
|
| }
|
|
|
| return event_mask;
|
|
|