This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
select on serial fix
- From: "Sergey Okhapkin" <sos at prospect dot com dot ru>
- To: "Cygwin-Patches" <cygwin-patches at cygwin dot com>
- Date: Fri, 15 Nov 2002 13:47:48 -0500
- Subject: 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