summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2020-05-28 22:49:26 +0900
committerCorinna Vinschen <corinna@vinschen.de>2020-05-28 16:44:36 +0200
commitb5089f339a2124f52dfe58c8e3c929e4c5634175 (patch)
tree68c34d6d5966d9aed524e85b2d58bd96a57f8203
parent25987b2c2a49013ce6d8c9d2ab29a92eb05f9482 (diff)
downloadcygnal-b5089f339a2124f52dfe58c8e3c929e4c5634175.tar.gz
cygnal-b5089f339a2124f52dfe58c8e3c929e4c5634175.tar.bz2
cygnal-b5089f339a2124f52dfe58c8e3c929e4c5634175.zip
Cygwin: pty: Prevent meaningless ResizePseudoConsole() calls.
- This patch prevents to call ResizePseudoConsole() unless the pty is resized.
-rw-r--r--winsup/cygwin/fhandler_tty.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index f29a2c214..b091765b3 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -2615,18 +2615,18 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
*(struct winsize *) arg = get_ttyp ()->winsize;
break;
case TIOCSWINSZ:
- /* FIXME: Pseudo console can be accessed via its handle
- only in the process which created it. What else can we do? */
- if (get_pseudo_console () && get_ttyp ()->master_pid == myself->pid)
- {
- COORD size;
- size.X = ((struct winsize *) arg)->ws_col;
- size.Y = ((struct winsize *) arg)->ws_row;
- ResizePseudoConsole (get_pseudo_console (), size);
- }
if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
|| get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
{
+ /* FIXME: Pseudo console can be accessed via its handle
+ only in the process which created it. What else can we do? */
+ if (get_pseudo_console () && get_ttyp ()->master_pid == myself->pid)
+ {
+ COORD size;
+ size.X = ((struct winsize *) arg)->ws_col;
+ size.Y = ((struct winsize *) arg)->ws_row;
+ ResizePseudoConsole (get_pseudo_console (), size);
+ }
get_ttyp ()->winsize = *(struct winsize *) arg;
get_ttyp ()->kill_pgrp (SIGWINCH);
}