aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2020-05-25 17:49:08 +0900
committerCorinna Vinschen <corinna@vinschen.de>2020-05-25 11:01:28 +0200
commit8d7a5b39d2fa3fe009dfae3fe90d6d2e9962f98e (patch)
treef83e05d4e8d33c27ee36a71ce2fb5581e67d34a4
parentc26e08095da0c4a32b082ff4c46d5ffd76c459d3 (diff)
downloadnewlib-8d7a5b39d2fa3fe009dfae3fe90d6d2e9962f98e.zip
newlib-8d7a5b39d2fa3fe009dfae3fe90d6d2e9962f98e.tar.gz
newlib-8d7a5b39d2fa3fe009dfae3fe90d6d2e9962f98e.tar.bz2
Cygwin: pty: Stop counting number of slaves attached to pseudo console.
- The number of slaves attached to pseudo console is used only for triggering redraw screen. Counting was not only needless, but also did not work as expected. This patch removes the code for counting.
-rw-r--r--winsup/cygwin/fhandler_tty.cc22
-rw-r--r--winsup/cygwin/tty.cc3
-rw-r--r--winsup/cygwin/tty.h1
3 files changed, 6 insertions, 20 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5faf896..df08dd2 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1019,8 +1019,6 @@ fhandler_pty_slave::close ()
fhandler_pty_common::close ();
if (!ForceCloseHandle (output_mutex))
termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex);
- if (pcon_attached_to == get_minor ())
- get_ttyp ()->num_pcon_attached_slaves --;
return 0;
}
@@ -2924,21 +2922,11 @@ fhandler_pty_slave::fixup_after_attach (bool native_maybe, int fd_set)
{
if (fhandler_console::get_console_process_id (get_helper_process_id (),
true))
- {
- if (pcon_attached_to != get_minor ())
- {
- pcon_attached_to = get_minor ();
- init_console_handler (true);
- }
- /* Clear screen to synchronize pseudo console screen buffer
- with real terminal. This is necessary because pseudo
- console screen buffer is empty at start. */
- if (get_ttyp ()->num_pcon_attached_slaves == 0)
- /* Assume this is the first process using this pty slave. */
- get_ttyp ()->need_redraw_screen = true;
-
- get_ttyp ()->num_pcon_attached_slaves ++;
- }
+ if (pcon_attached_to != get_minor ())
+ {
+ pcon_attached_to = get_minor ();
+ init_console_handler (true);
+ }
#if 0 /* This is for debug only. */
isHybrid = true;
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 3fc46fb..efdae46 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -242,9 +242,8 @@ tty::init ()
screen_alternated = false;
mask_switch_to_pcon_in = false;
pcon_pid = 0;
- num_pcon_attached_slaves = 0;
term_code_page = 0;
- need_redraw_screen = false;
+ need_redraw_screen = true;
fwd_done = NULL;
pcon_last_time = 0;
pcon_in_empty = true;
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h
index c4dd2e4..7d6fc8f 100644
--- a/winsup/cygwin/tty.h
+++ b/winsup/cygwin/tty.h
@@ -103,7 +103,6 @@ private:
bool screen_alternated;
bool mask_switch_to_pcon_in;
pid_t pcon_pid;
- int num_pcon_attached_slaves;
UINT term_code_page;
bool need_redraw_screen;
HANDLE fwd_done;