David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/23693 )
Change subject: improve termios settings on some OSes ......................................................................
Patch Set 2: Code-Review-1
(1 comment)
Need to figure out what to do with ECHOCTL and ECHOKE.
https://review.coreboot.org/c/flashrom/+/23693/2/serial.c File serial.c:
https://review.coreboot.org/c/flashrom/+/23693/2/serial.c@215 PS2, Line 215: wanted.c_lflag &= ~(ECHOCTL | ECHOKE); According to the Open Group [1] these two flags should generally be avoided for portability. Also, the GNU libc manual [2] notes that there are BSD extensions and exist "only in BSD systems and GNU/Linux and GNU/Hurd systems."
So I guess if this line is included, we should wrap it with a #if for the BSDs and GNU? Or '#if !defined( _POSIX_SOURCE)'?
[1] https://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html [2] https://www.gnu.org/software/libc/manual/html_node/Local-Modes.html