This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Cygwin hangs up if several keys are typed during outputting a lot of texts.
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 3 Apr 2015 11:24:33 -0000
- Subject: [newlib-cygwin] Cygwin hangs up if several keys are typed during outputting a lot of texts.
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8e01f34ed10291506e395eb57a96231d3bd58d3d
commit 8e01f34ed10291506e395eb57a96231d3bd58d3d
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Fri Apr 3 13:07:35 2015 +0900
Cygwin hangs up if several keys are typed during outputting a lot of texts.
* fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
"readlen" not to use "bytes_in_pipe" value directly.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/ChangeLog | 5 +++++
winsup/cygwin/fhandler_tty.cc | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 3b0e111..5ada35d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-03 Takashi Yano <takashi.yano@nifty.ne.jp>
+
+ * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
+ "readlen" not to use "bytes_in_pipe" value directly.
+
2015-04-02 Jon TURNEY <jon.turney@dronecode.org.uk>
* include/cygwin/signal.h (struct __mcontext): 16-byte align.
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 89cc9e5..daa24eb 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