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

Unified Diff: runtime/bin/eventhandler_macos.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_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;

Powered by Google App Engine
This is Rietveld 408576698