summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2019-09-04 10:44:24 +0900
committerCorinna Vinschen <corinna@vinschen.de>2019-09-04 11:59:46 +0200
commitbddb018e10e90ea300537d5a13999558b7dce476 (patch)
treeb119d330387e58de039177f7ddf14c86c0a5ae15
parent9adb260181fa148fad0e91c55e41ea6d75eb8eb8 (diff)
downloadcygnal-bddb018e10e90ea300537d5a13999558b7dce476.tar.gz
cygnal-bddb018e10e90ea300537d5a13999558b7dce476.tar.bz2
cygnal-bddb018e10e90ea300537d5a13999558b7dce476.zip
Cygwin: pty: Speed up a little hooked Win32 API for pseudo console.
- Some Win32 APIs are hooked in pty code for pseudo console support. This causes slow down. This patch improves speed a little.
-rw-r--r--winsup/cygwin/fhandler_tty.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 4dbe96b4a..94ef2f8d4 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -155,7 +155,9 @@ DEF_HOOK (PeekConsoleInputW);
#define CHK_CONSOLE_ACCESS(h) \
{ \
DWORD dummy; \
- if (!isHybrid && GetConsoleMode (h, &dummy)) \
+ if (!isHybrid \
+ && GetFileType (h) == FILE_TYPE_CHAR \
+ && GetConsoleMode (h, &dummy)) \
{ \
isHybrid = true; \
set_switch_to_pcon (); \