aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-09-10 19:16:07 +0000
committerRoland McGrath <roland@gnu.org>2003-09-10 19:16:07 +0000
commite99e03878b01767e8a7fa191cfdc9a11dfe0feab (patch)
treeb6c39b804b204f22ab10937994fdead3644a8a15 /sysdeps/unix/sysv/linux/tcgetattr.c
parentUpdate. (diff)
downloadglibc-e99e03878b01767e8a7fa191cfdc9a11dfe0feab.tar.gz
glibc-e99e03878b01767e8a7fa191cfdc9a11dfe0feab.tar.bz2
glibc-e99e03878b01767e8a7fa191cfdc9a11dfe0feab.zip
2003-09-10 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Don't use c_ispeed under [! _HAVE_STRUCT_TERMIOS_C_ISPEED]. Don't use c_ospeed under [! _HAVE_STRUCT_TERMIOS_C_OSPEED]. * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise. Reported by Daniel Jacobowitz <drow@mvista.com>.
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcgetattr.c')
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 25b5b51fbb..63453ca031 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -45,15 +45,19 @@ __tcgetattr (fd, termios_p)
termios_p->c_cflag = k_termios.c_cflag;
termios_p->c_lflag = k_termios.c_lflag;
termios_p->c_line = k_termios.c_line;
-#ifdef _HAVE_C_ISPEED
+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
+# ifdef _HAVE_C_ISPEED
termios_p->c_ispeed = k_termios.c_ispeed;
-#else
+# else
termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
+# endif
#endif
-#ifdef _HAVE_C_OSPEED
+#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED
+# ifdef _HAVE_C_OSPEED
termios_p->c_ospeed = k_termios.c_ospeed;
-#else
+# else
termios_p->c_ospeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
+# endif
#endif
if (sizeof (cc_t) == 1 || _POSIX_VDISABLE == 0
|| (unsigned char) _POSIX_VDISABLE == (unsigned char) -1)