aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tcgetattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcgetattr.c')
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 8a6fd59cd4..25b5b51fbb 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -47,9 +47,13 @@ __tcgetattr (fd, termios_p)
termios_p->c_line = k_termios.c_line;
#ifdef _HAVE_C_ISPEED
termios_p->c_ispeed = k_termios.c_ispeed;
+#else
+ termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
#endif
#ifdef _HAVE_C_OSPEED
termios_p->c_ospeed = k_termios.c_ospeed;
+#else
+ termios_p->c_ospeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
#endif
if (sizeof (cc_t) == 1 || _POSIX_VDISABLE == 0
|| (unsigned char) _POSIX_VDISABLE == (unsigned char) -1)