diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3b0e11187..5ada35de4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-04-03 Takashi Yano + + * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of + "readlen" not to use "bytes_in_pipe" value directly. + 2015-04-02 Jon TURNEY * include/cygwin/signal.h (struct __mcontext): 16-byte align. diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 89cc9e555..daa24ebcc 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -742,7 +742,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len) return; } - readlen = MIN (bytes_in_pipe, MIN (len, sizeof (buf))); + readlen = bytes_in_pipe ? MIN (len, sizeof (buf)) : 0; #if 0 /* Why on earth is the read length reduced to vmin, even if more bytes