www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/24/15:13:22

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <37EBC974.530E6E53@pigeonpoint.com>
Disposition-Notification-To: Stas Maximov <stmax AT pigeonpoint DOT com>
Date: Fri, 24 Sep 1999 11:56:52 -0700
From: Stas Maximov <stmax AT pigeonpoint DOT com>
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: b20.1: fhandler_serial.cc: stuck error: fAbortOnError & ClearCommError
is never called

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019