| 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();
|
| }
|
|
|