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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 12328052: Handle single EPOLLHUP epoll events on Linux. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 7b5bd707acd67685363c626192fab313885a7416..ff06e560e89a463c18b21895bc42e8ec9ae94e79 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -265,8 +265,9 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
}
} else {
// Prioritize data events over close and error events.
- if ((events & EPOLLIN) != 0) {
- if (FDUtils::AvailableBytes(sd->fd()) != 0) {
+ if ((events & (EPOLLIN | EPOLLHUP | EPOLLERR)) != 0) {
+ // If we have EPOLLIN and we have available writes, report that.
Søren Gjesse 2013/02/22 11:41:20 writes -> bytes
Anders Johnsen 2013/02/22 11:42:19 Done.
+ if ((events & EPOLLIN) && FDUtils::AvailableBytes(sd->fd()) != 0) {
event_mask = (1 << kInEvent);
} else if ((events & EPOLLHUP) != 0) {
// If both EPOLLHUP and EPOLLERR are reported treat it as an
@@ -306,19 +307,6 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
}
}
- // On pipes EPOLLHUP is reported without EPOLLIN when there is no
- // more data to read.
- if (sd->IsPipe()) {
- if (((events & EPOLLIN) == 0) &&
- ((events & EPOLLHUP) != 0)) {
- event_mask = (1 << kCloseEvent);
- sd->MarkClosedRead();
- }
- } else {
- // Assert we never get an EPOLLHUP on a non-pipe file-descriptor.
- ASSERT(events != EPOLLHUP);
- }
-
if ((events & EPOLLOUT) != 0) {
if ((events & EPOLLERR) != 0) {
event_mask = (1 << kErrorEvent);
@@ -327,12 +315,6 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
event_mask |= (1 << kOutEvent);
}
}
-
- if (events == (EPOLLHUP | EPOLLERR)) {
- event_mask = (1 << kErrorEvent);
- sd->MarkClosedWrite();
- sd->MarkClosedRead();
- }
}
return event_mask;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698