mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
* fhandler.h (fhandler_serial::ev): New class member.
* fhandler_serial.cc (fhandler_serial::raw_read): Use class member for event status. * select.cc (peek_serial): Ditto.
This commit is contained in:
parent
cf77faefc8
commit
40139114ea
@ -1,3 +1,10 @@
|
||||
2001-12-10 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* fhandler.h (fhandler_serial::ev): New class member.
|
||||
* fhandler_serial.cc (fhandler_serial::raw_read): Use class member for
|
||||
event status.
|
||||
* select.cc (peek_serial): Ditto.
|
||||
|
||||
2001-12-07 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* path.cc (path_conv::check): Use full path name for determining
|
||||
|
@ -582,6 +582,7 @@ class fhandler_serial: public fhandler_base
|
||||
public:
|
||||
int overlapped_armed;
|
||||
OVERLAPPED io_status;
|
||||
DWORD ev;
|
||||
|
||||
/* Constructor */
|
||||
fhandler_serial (int unit);
|
||||
|
@ -60,7 +60,6 @@ fhandler_serial::raw_read (void *ptr, size_t ulen)
|
||||
|
||||
for (n = 0, tot = 0; ulen; ulen -= n, ptr = (char *)ptr + n)
|
||||
{
|
||||
DWORD ev;
|
||||
COMSTAT st;
|
||||
DWORD inq = 1;
|
||||
|
||||
@ -374,7 +373,6 @@ fhandler_serial::tcflush (int queue)
|
||||
(we stop after 1000 chars anyway) */
|
||||
for (int max = 1000; max > 0; max--)
|
||||
{
|
||||
DWORD ev;
|
||||
COMSTAT st;
|
||||
if (!PurgeComm (get_handle (), PURGE_RXABORT | PURGE_RXCLEAR))
|
||||
break;
|
||||
|
@ -865,7 +865,6 @@ struct serialinf
|
||||
static int
|
||||
peek_serial (select_record *s, bool)
|
||||
{
|
||||
DWORD ev;
|
||||
COMSTAT st;
|
||||
|
||||
fhandler_serial *fh = (fhandler_serial *)s->fh;
|
||||
@ -890,19 +889,18 @@ peek_serial (select_record *s, bool)
|
||||
|
||||
if (!fh->overlapped_armed)
|
||||
{
|
||||
DWORD ev;
|
||||
COMSTAT st;
|
||||
|
||||
ResetEvent (fh->io_status.hEvent);
|
||||
|
||||
if (!ClearCommError (h, &ev, &st))
|
||||
if (!ClearCommError (h, &fh->ev, &st))
|
||||
{
|
||||
debug_printf ("ClearCommError");
|
||||
goto err;
|
||||
}
|
||||
else if (st.cbInQue)
|
||||
return s->read_ready = true;
|
||||
else if (WaitCommEvent (h, &ev, &fh->io_status))
|
||||
else if (WaitCommEvent (h, &fh->ev, &fh->io_status))
|
||||
return s->read_ready = true;
|
||||
else if (GetLastError () == ERROR_IO_PENDING)
|
||||
fh->overlapped_armed = 1;
|
||||
@ -923,7 +921,7 @@ peek_serial (select_record *s, bool)
|
||||
switch (WaitForMultipleObjects (2, w4, FALSE, to))
|
||||
{
|
||||
case WAIT_OBJECT_0:
|
||||
if (!ClearCommError (h, &ev, &st))
|
||||
if (!ClearCommError (h, &fh->ev, &st))
|
||||
{
|
||||
debug_printf ("ClearCommError");
|
||||
goto err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user