public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* b20.1: fhandler_serial.cc: stuck error: fAbortOnError & ClearCommError is never called
@ 1999-09-24 12:11 Stas Maximov
  1999-09-24 13:00 ` ld or gcc failing? Emmanuel STAPF
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Stas Maximov @ 1999-09-24 12:11 UTC (permalink / raw)
  To: cygwin

Description:

If parity error INPCK & !IGNPAR and parity error happens on serial port
(replugged cables on the fly, while app holds the port's descriptor),
all further read/write calls fail with EACCES.

Explanation:

fhandler_serial::tcsetattr sets Win32 DCB::fAbortOnError that means that
any error condition on the port (and parity is one of them) will abort
IO operation ReadFile/WriteFile with ERROR_OPERATION_ABORTED(995) and
all further IO operations will fail with the same error till
ClearCommError is called.

fhandler_serial::tcsetattr sets DCB::fAbortOnError, but never calls
ClearCommError to clear the error condition.

Another thing is that fhandler_serial::open does not set
DCB::fAbortOnError, so the behavior is different when you use default
settings and try to set the default settings using tcsetattr.

Solution:

1. Make fhandler_serial::open to be consistent with
fhandler_serial::tcsetattr, i.e. both of them will set
DCB::fAbortOnError.

2. Modify fhandler_serial::raw_read/raw_write that will basically use
fhandler_base::raw_read/raw_write, but in case ERROR_OPERATION_ABORTED
happens, they will proceed according to termios settings on the device.

3. Add termios as a member to fhandler_serial. Check if fhandle_union is
still fhsndle_console after that!

Question:

I am willing to fix it. Do I have to subscribe to cygwin-developers
list?

Stas.



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-24 12:11 b20.1: fhandler_serial.cc: stuck error: fAbortOnError & ClearCommError is never called Stas Maximov
1999-09-24 13:00 ` ld or gcc failing? Emmanuel STAPF
1999-09-24 13:37   ` Michael K. Elwood
1999-09-24 14:31     ` Mumit Khan
1999-09-25 13:01       ` Re[2]: " Paul Sokolovsky
1999-09-27 12:16         ` Mumit Khan
1999-09-28  7:29           ` Re[4]: " Paul Sokolovsky
1999-09-30 23:42             ` Paul Sokolovsky
1999-09-30 23:42           ` Re[2]: " Mumit Khan
1999-09-30 23:42         ` Paul Sokolovsky
1999-09-27  0:47       ` Richard
1999-09-27 12:24         ` Mumit Khan
1999-09-27 12:55           ` Richard
1999-09-28  7:09             ` Re[2]: " Paul Sokolovsky
1999-09-30 23:42               ` Paul Sokolovsky
1999-09-30 23:42             ` Richard
1999-09-30 23:42           ` Mumit Khan
1999-09-30 23:42         ` Richard
1999-09-30 23:42       ` Mumit Khan
1999-09-30 23:42     ` Michael K. Elwood
1999-09-30 23:42   ` Emmanuel STAPF
1999-09-24 14:49 ` b20.1: fhandler_serial.cc: stuck error: fAbortOnError & ClearCommError is never called Chris Faylor
1999-09-26 16:36   ` VC++ compiled DLL don't work properly with cygnus pakko2
1999-09-27 12:25     ` Mumit Khan
1999-09-30 23:42       ` Mumit Khan
1999-09-30 23:42     ` pakko2
1999-09-30 23:42   ` b20.1: fhandler_serial.cc: stuck error: fAbortOnError & ClearCommError is never called Chris Faylor
1999-09-30 23:42 ` Stas Maximov

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