public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: serial: select: fix previous revamp patch
@ 2020-03-26 11:26 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-03-26 11:26 UTC (permalink / raw)
  To: cygwin-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2241 bytes --]

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

commit e4f9fc92ac613f0ae6cf44de7fdd6229c50168e4
Author: Åke Rehnman <ake.rehnman@gmail.com>
Date:   Fri Mar 20 10:37:17 2020 +0100

    Cygwin: serial: select: fix previous revamp patch
    
    - We need a verify function.
    - The event object referenced in WaitCommEvent must not be a local var,
      move it into fhandler_serial.

Diff:
---
 winsup/cygwin/fhandler.h |  1 +
 winsup/cygwin/select.cc  | 12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 923313df4..45e256e77 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1685,6 +1685,7 @@ class fhandler_serial: public fhandler_base
   pid_t pgrp_;
   int rts;				/* for Windows 9x purposes only */
   int dtr;				/* for Windows 9x purposes only */
+  DWORD event;				/* for select */
 
  public:
   OVERLAPPED io_status;
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 93820ae77..e11f5850a 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1493,14 +1493,18 @@ serial_read_cleanup (select_record *s, select_stuff *stuff)
     }
 }
 
+verify_serial (select_record *me, fd_set *rfds, fd_set *wfds, fd_set *efds)
+{
+  return peek_serial (me, true);
+}
+
 select_record *
 fhandler_serial::select_read (select_stuff *ss)
 {
-  DWORD event;
   select_record *s = ss->start.next;
 
   s->startup = no_startup;
-  s->verify = verify_ok;
+  s->verify = verify_serial;
   s->cleanup = serial_read_cleanup;
   s->peek = peek_serial;
   s->read_selected = true;
@@ -1521,7 +1525,7 @@ fhandler_serial::select_write (select_stuff *ss)
   select_record *s = ss->start.next;
 
   s->startup = no_startup;
-  s->verify = verify_ok;
+  s->verify = verify_serial;
   s->peek = peek_serial;
   s->write_selected = true;
   s->write_ready = true;
@@ -1534,7 +1538,7 @@ fhandler_serial::select_except (select_stuff *ss)
   select_record *s = ss->start.next;
 
   s->startup = no_startup;
-  s->verify = verify_ok;
+  s->verify = verify_serial;
   s->peek = peek_serial;
   s->except_selected = false;	// Can't do this
   s->except_ready = false;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-26 11:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 11:26 [newlib-cygwin] Cygwin: serial: select: fix previous revamp patch Corinna Vinschen

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).