Chromium Code Reviews| Index: runtime/bin/eventhandler_linux.cc |
| diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc |
| index b0e29507c82bca2ac65d973c6b81aa2e24c50179..694c7021d2d07be15db78672261f7b7bdcb20c0a 100644 |
| --- a/runtime/bin/eventhandler_linux.cc |
| +++ b/runtime/bin/eventhandler_linux.cc |
| @@ -215,6 +215,7 @@ static void PrintEventMask(struct pollfd* pollfd) { |
| intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) { |
| #ifdef DEBUG_POLL |
| + printf("Poll events:\n"); |
|
Mads Ager (google)
2011/11/23 12:45:19
Do you want to add this debugging line in the maco
Søren Gjesse
2011/11/23 14:50:18
Yes, to separate each return from poll.
|
| if (pollfd->fd != interrupt_fds_[0]) PrintEventMask(pollfd); |
| #endif |
| intptr_t event_mask = 0; |
| @@ -266,7 +267,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 +277,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; |