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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 12476021: Handle /dev/null on linux, as an closed device. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug print. Created 7 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 | « no previous file | 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 ce99057561049538fed7657ba50e9087e48bdc49..7cd9e5140b743c4cafaddf7619ebf155a2f13031 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -84,7 +84,14 @@ static void UpdateEpollInstance(intptr_t epoll_fd_, SocketData* sd) {
sd->set_tracked_by_epoll(true);
}
if (status == -1) {
- FATAL1("Failed updating epoll instance: %s", strerror(errno));
+ // Epoll does not accept the file descriptor. It could be due to
+ // already closed file descriptor, or unuspported devices, such
+ // as /dev/null. In such case, mark the file descriptor as closed,
+ // so dart will handle it accordingly.
+ sd->set_tracked_by_epoll(false);
+ sd->ShutdownRead();
+ sd->ShutdownWrite();
+ DartUtils::PostInt32(sd->port(), 1 << kCloseEvent);
}
}
}
« no previous file with comments | « no previous file | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698