This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 2/4] Cygwin: pty: Speed up a little hooked Win32 API for pseudo console.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin-patches at cygwin dot com
- Cc: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- Date: Wed, 4 Sep 2019 10:44:24 +0900
- Subject: [PATCH 2/4] Cygwin: pty: Speed up a little hooked Win32 API for pseudo console.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-05.nifty.com x841iibF012450
- References: <20190904014426.1284-1-takashi.yano@nifty.ne.jp>
- Some Win32 APIs are hooked in pty code for pseudo console support.
This causes slow down. This patch improves speed a little.
---
winsup/cygwin/fhandler_tty.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 (); \
--
2.21.0