]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: drop wincap::cons_need_small_input_record_buf
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 15 Nov 2022 16:43:15 +0000 (17:43 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sun, 4 Dec 2022 13:01:41 +0000 (14:01 +0100)
Only required for Windows 7.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler/console.cc
winsup/cygwin/local_includes/wincap.h
winsup/cygwin/wincap.cc

index a4a367005da4119dc1173e343b1b2c0dc4aa2bc1..bbf4b0103b9579609faae5b33adfdc3e332f2651 100644 (file)
@@ -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;
                              }
index c26324fd6dac00d04668669f4260dc3047e836b5..96bd68a93f95fab2113555bd4ea4b6d439398904 100644 (file)
@@ -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 ()
   {
index fe5986c76e214f6072050dafe5fde8cde5449426..f83eed8a7e1a9e00164465b9ba0634b0067fe85c 100644 (file)
@@ -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,
   },
 };
 
This page took 0.052022 seconds and 5 git commands to generate.