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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 8879053: Don't treat stdin from a terminal differently from piped input (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed debugging code Created 9 years 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 15a57a1757213c314ec4404a32303969cf2bf45a..478983533c10a2d123b6cb1795db90dfe8709596 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -243,9 +243,10 @@ intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) {
event_mask = (1 << kErrorEvent);
} else {
if (sd->IsPipe()) {
- // For stdin when reading from a terminal treat POLLIN with 0
- // available bytes as end-of-file.
- if (sd->fd() == STDIN_FILENO && isatty(sd->fd())) {
+ // When reading from stdin (either from a terminal or piped
+ // input) treat POLLIN with 0 available bytes as
+ // end-of-file.
+ if (sd->fd() == STDIN_FILENO) {
event_mask = (1 << kCloseEvent);
sd->MarkClosedRead();
}
« 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