public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: drop wincap::cons_need_small_input_record_buf
Date: Sun,  4 Dec 2022 13:27:47 +0000 (GMT)	[thread overview]
Message-ID: <20221204132747.7DA30384F480@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8af023a357fba8974be89af41a6c42d09374ac46

commit 8af023a357fba8974be89af41a6c42d09374ac46
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Tue Nov 15 17:43:15 2022 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Sun Dec 4 14:01:41 2022 +0100

    Cygwin: drop wincap::cons_need_small_input_record_buf
    
    Only required for Windows 7.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/console.cc     | 29 +++++++++--------------------
 winsup/cygwin/local_includes/wincap.h |  2 --
 winsup/cygwin/wincap.cc               | 12 ------------
 3 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc
index a4a367005da4..bbf4b0103b95 100644
--- a/winsup/cygwin/fhandler/console.cc
+++ b/winsup/cygwin/fhandler/console.cc
@@ -302,9 +302,6 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
       return;
     }
 
-  DWORD inrec_size1 =
-    wincap.cons_need_small_input_record_buf () ? INREC_SIZE : inrec_size;
-
   struct m
   {
     inline static size_t bytes (size_t n)
@@ -354,11 +351,7 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
 	  if (new_input_tmp)
 	    input_tmp = new_input_tmp;
 	  if (new_input_rec && new_input_tmp)
-	    {
-	      inrec_size = new_inrec_size;
-	      if (!wincap.cons_need_small_input_record_buf ())
-		inrec_size1 = inrec_size;
-	    }
+	    inrec_size = new_inrec_size;
 	}
 
       WaitForSingleObject (p->input_mutex, mutex_timeout);
@@ -373,7 +366,7 @@ fhandler_console::cons_master_thread (handle_set_t *p, tty *ttyp)
 	    {
 	      DWORD len;
 	      ReadConsoleInputW (p->input_handle, input_rec + total_read,
-				 min (inrec_size - total_read, inrec_size1),
+				 min (inrec_size - total_read, inrec_size),
 				 &len);
 	      total_read += len;
 	    }
@@ -471,7 +464,7 @@ remove_record:
 		{
 		  DWORD len;
 		  WriteConsoleInputW (p->input_handle, input_rec + n,
-				      min (total_read - n, inrec_size1), &len);
+				      min (total_read - n, inrec_size), &len);
 		  n += len;
 		}
 	      release_attach_mutex ();
@@ -491,22 +484,18 @@ remove_record:
 		  if (new_input_tmp)
 		    input_tmp = new_input_tmp;
 		  if (new_input_rec && new_input_tmp)
-		    {
-		      inrec_size = new_inrec_size;
-		      if (!wincap.cons_need_small_input_record_buf ())
-			inrec_size1 = inrec_size;
-		    }
+		    inrec_size = new_inrec_size;
 		}
 
 	      /* Check if writeback was successfull. */
 	      acquire_attach_mutex (mutex_timeout);
-	      PeekConsoleInputW (p->input_handle, input_tmp, inrec_size1, &n);
+	      PeekConsoleInputW (p->input_handle, input_tmp, inrec_size, &n);
 	      release_attach_mutex ();
-	      if (n < min (total_read, inrec_size1))
+	      if (n < min (total_read, inrec_size))
 		break; /* Someone has read input without acquiring
 			  input_mutex. ConEmu cygwin-connector? */
 	      if (inrec_eq (input_rec, input_tmp,
-			    min (total_read, inrec_size1)))
+			    min (total_read, inrec_size)))
 		break; /* OK */
 	      /* Try to fix */
 	      acquire_attach_mutex (mutex_timeout);
@@ -516,7 +505,7 @@ remove_record:
 		{
 		  DWORD len;
 		  ReadConsoleInputW (p->input_handle, input_tmp + n,
-				     min (inrec_size - n, inrec_size1), &len);
+				     min (inrec_size - n, inrec_size), &len);
 		  n += len;
 		}
 	      release_attach_mutex ();
@@ -549,7 +538,7 @@ remove_record:
 				DWORD len;
 				WriteConsoleInputW (p->input_handle,
 						    input_tmp + l,
-						    min (n - l, inrec_size1),
+						    min (n - l, inrec_size),
 						    &len);
 				l += len;
 			      }
diff --git a/winsup/cygwin/local_includes/wincap.h b/winsup/cygwin/local_includes/wincap.h
index c26324fd6dac..96bd68a93f95 100644
--- a/winsup/cygwin/local_includes/wincap.h
+++ b/winsup/cygwin/local_includes/wincap.h
@@ -33,7 +33,6 @@ struct wincaps
     unsigned has_linux_tcp_keepalive_sockopts			: 1;
     unsigned has_tcp_maxrtms					: 1;
     unsigned has_con_broken_tabs				: 1;
-    unsigned cons_need_small_input_record_buf			: 1;
   };
 };
 
@@ -86,7 +85,6 @@ public:
   bool	IMPLEMENT (has_linux_tcp_keepalive_sockopts)
   bool	IMPLEMENT (has_tcp_maxrtms)
   bool	IMPLEMENT (has_con_broken_tabs)
-  bool	IMPLEMENT (cons_need_small_input_record_buf)
 
   void disable_case_sensitive_dirs ()
   {
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index fe5986c76e21..f83eed8a7e1a 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -40,7 +40,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:false,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:true,
   },
 };
 
@@ -65,7 +64,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:false,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -90,7 +88,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:false,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -115,7 +112,6 @@ wincaps  wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared))
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:false,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -140,7 +136,6 @@ wincaps  wincap_10_1607 __attribute__((section (".cygwin_dll_common"), shared))
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -165,7 +160,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:false,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -190,7 +184,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -215,7 +208,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -240,7 +232,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -265,7 +256,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -290,7 +280,6 @@ wincaps wincap_10_2004 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:true,
-    cons_need_small_input_record_buf:false,
   },
 };
 
@@ -315,7 +304,6 @@ wincaps wincap_11 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_linux_tcp_keepalive_sockopts:true,
     has_tcp_maxrtms:true,
     has_con_broken_tabs:false,
-    cons_need_small_input_record_buf:false,
   },
 };

                 reply	other threads:[~2022-12-04 13:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221204132747.7DA30384F480@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).