]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2003-09-10 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@gnu.org>
Wed, 10 Sep 2003 19:16:07 +0000 (19:16 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 10 Sep 2003 19:16:07 +0000 (19:16 +0000)
* 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>.

sysdeps/unix/sysv/linux/tcgetattr.c
sysdeps/unix/sysv/linux/tcsetattr.c

index 25b5b51fbbf01a5b5c38d57ce7cf109d8498dcc8..63453ca031b0903ba4dc9ecba69ae51e24357cec 100644 (file)
@@ -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)
index 6005119733c89f728a6163122021a3e2e40eeb48..f73ec8883e61dee19ed349c6a64170dfefb59130 100644 (file)
@@ -71,10 +71,10 @@ tcsetattr (fd, optional_actions, termios_p)
   k_termios.c_cflag = termios_p->c_cflag;
   k_termios.c_lflag = termios_p->c_lflag;
   k_termios.c_line = termios_p->c_line;
-#ifdef _HAVE_C_ISPEED
+#if defined _HAVE_C_ISPEED && defined _HAVE_STRUCT_TERMIOS_C_ISPEED
   k_termios.c_ispeed = termios_p->c_ispeed;
 #endif
-#ifdef _HAVE_C_OSPEED
+#if defined _HAVE_C_OSPEED && defined _HAVE_STRUCT_TERMIOS_C_OSPEED
   k_termios.c_ospeed = termios_p->c_ospeed;
 #endif
   memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],