[Toybox] [PATCH] microcom, stty: Use TCSADRAIN to set tty device attribute

Yi-Yo Chiang yochiang at google.com
Mon May 20 21:43:05 PDT 2024


Don't flush the tty device input queue when setting device attribute.

Rationale:
  * microcom: The tty device might already have a _good enough_ termios
    to read data from. Flushing the input queue just to set the terminal
    attribute would result in data loss in this case.
  * stty: This command doesn't read nor write data to the tty device, so
    flushing the input queue doesn't make sense here. The program
    actually talking to the tty should decide if it wants the tty
    flushed or not.
    Note: other implementations of stty also uses TCSANOW (bsd) or
    TCSADRAIN (coreutils), so I think this assumption is fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240521/96f47d1f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-microcom-stty-Use-TCSADRAIN-to-set-tty-device-attrib.patch
Type: application/x-patch
Size: 2296 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240521/96f47d1f/attachment.bin>


More information about the Toybox mailing list