Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 8662006: Fix a number of issues with the process handling (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698