From: chris AT algor DOT co DOT uk (Chris Dearman) Subject: tcsetattr calls cause framing errors 20 Feb 1998 20:30:46 -0800 Message-ID: <199802202223.WAA08169.cygnus.gnu-win32@embankment.algor.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Sergey DOT Okhapkin AT algor DOT co DOT uk (sos AT prospect DOT com DOT ru) Cc: gnu-win32 AT cygnus DOT com I noticed a problem when using the coolview cygwin.dll (634339 Nov 3 07:04) on an NT4.0 machine. It appears that calls to SetCommState reprogram the serial chip even if the device parameters are unchanged. Calling tcsetattr to modify the timeout parameters (something that gdb does frequently...) can cause received data to be scrambled. The attached patch works round the problem by only calling SetCommState if the device parameters have actually changed. It also preserves the parity and stop bit settings. I'm not sure if the handling for ERROR_OPERATION_ABORTED in ReadFile is really appropriate; it's needed because any serial error will make the device inaccessible until ClearCommError is called. It might be better to simply stop the error from being generated by clearing nstate.fAbortOnError in the tcsetattr call. Regards Chris [ATTACHMENT /usr/algor/chris/fhandler.cc.diffs, application/octet-stream] -- Chris Dearman, Algorithmics Ltd, 3 Drayton Park, London, N5 1NU, England Phone: +44 171 700 3301 FAX: +44 171 700 3400 Email: chris AT algor DOT co DOT uk - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".