race in tty handling code

Egor Duda deo@logos-m.ru
Thu Feb 22 03:05:00 GMT 2001


Hi!

  if  application performs write to tty with ONLCR flag turned off and
  then    immediately    calls    tcsetattr    to    turn    it    on,
fhandler_pty_master::process_slave_output     gets    confused.   it
calculates rlen according to old tty settings and signals output_done
event.  then  it process the buffer according to new tty settings, and
stumbles  over  internal  error  message. Patch attached  (well,  this
time  i  triple-checked  that  it does contain changelog entry :)

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19
tty-write-tcsetattr-race.ChangeLog
tty-write-tcsetattr-race.diff

-------------- next part --------------
2001-02-22  Egor Duda  <deo@logos-m.ru>

	* fhandler_tty.cc (fhandler_pty_master::process_slave_output):
	Signal that output is done only after buffer conversion to avoid
	race.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tty-write-tcsetattr-race.diff
Type: text/x-diff
Size: 1480 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20010222/37b72ede/attachment.bin>


More information about the Cygwin-patches mailing list