This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tcsetattr calls cause framing errors



  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@algor.co.uk
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]