From f759c0e3cc28fa9730f3692a897b7f3e311ada38 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Fri, 18 Jun 2021 15:45:23 +0200 Subject: [PATCH] Correct termios2 baud rate calculation Based on suggestion by joluxer . --- src/ttynvt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ttynvt.c b/src/ttynvt.c index 549244f..3e502cd 100644 --- a/src/ttynvt.c +++ b/src/ttynvt.c @@ -743,7 +743,10 @@ static unsigned int _tio_baud(const struct termios2 *tio) static unsigned int _tio2_baud(const struct termios2 *tio2) { - return tio2->c_ospeed; + if ((tio2->c_cflag & CBAUD) == BOTHER) + return tio2->c_ospeed; + + return _tio_baud(tio2); } static unsigned int _tio_csize(const struct termios2 *tio)