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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 9720045: Extend dart:io error handling to all socket functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 9 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 | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/eventhandler_macos.cc » ('j') | 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 5ee2f84d69f020933430ee334064bd7797c02c21..2609dc5d76aff52dbb77c97dc57263ff4e48f6ac 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -261,8 +261,14 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
if ((events & EPOLLIN) != 0) {
if (FDUtils::AvailableBytes(sd->fd()) != 0) {
event_mask = (1 << kInEvent);
- } else if (((events & EPOLLHUP) != 0)) {
- event_mask = (1 << kCloseEvent);
+ } else if ((events & EPOLLHUP) != 0) {
+ // If both EPOLLHUP and EPOLLERR are reported treat it as an
+ // error.
+ if ((events & EPOLLERR) != 0) {
+ event_mask = (1 << kErrorEvent);
+ } else {
+ event_mask = (1 << kCloseEvent);
+ }
sd->MarkClosedRead();
} else if ((events & EPOLLERR) != 0) {
event_mask = (1 << kErrorEvent);
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698