This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

select on serial fix


The patch fixes a problem with a characters loss on select on a serial port.
I wonder what PurgeComm() calls in the original code supposed to do...


2002-11-15  Sergey Okhapkin  <sos@prospect.com.ru>

        * select.cc (peek_serial): Don't call PurgeComm() to avoid
characters loss.




Index: select.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/select.cc,v
retrieving revision 1.81
diff -u -p -r1.81 select.cc
--- select.cc   30 Sep 2002 15:17:44 -0000      1.81
+++ select.cc   15 Nov 2002 18:41:10 -0000
@@ -912,19 +912,15 @@ peek_serial (select_record *s, bool)
          return s->read_ready = true;
          select_printf ("got something");
        }
-      PurgeComm (h, PURGE_TXABORT | PURGE_RXABORT);
       break;
     case WAIT_OBJECT_0 + 1:
-      PurgeComm (h, PURGE_TXABORT | PURGE_RXABORT);
       select_printf ("interrupt");
       set_sig_errno (EINTR);
       ready = -1;
       break;
     case WAIT_TIMEOUT:
-      PurgeComm (h, PURGE_TXABORT | PURGE_RXABORT);
       break;
     default:
-      PurgeComm (h, PURGE_TXABORT | PURGE_RXABORT);
       debug_printf ("WaitForMultipleObjects");
       goto err;
     }

Sergey Okhapkin
Somerset, NJ



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]