This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c_ispeed fix for tcgetattr/tcsetattr [more patch for sparc]


On Wednesday 10 September 2003 13:04, Daniel Jacobowitz wrote:
> New problem in the CVS sources - tcgetattr/tcsetattr check c_ispeed and
> c_ospeed unconditionally, but at least MIPS doesn't provide them.

Thanks, confirm that worked for sparc/sparc64 too ....

Dont know about #ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED condition only know that way compile and works,
probably it can be even #ifdef ABRACADABRA  or even can delete ->c_ospeed ->c_inspeed

In fact the patch for sparc is little bit more than original for mips it touch speed.c too
and solve older compile problem posted by me about 3 hour:

--- glibc-2.3.2-200309061641/sysdeps/unix/sysv/linux/speed.c.orig       Sat Sep  6 05:52:52 2003
+++ glibc-2.3.2-200309061641/sysdeps/unix/sysv/linux/speed.c    Wed Sep 10 21:50:15 2003
@@ -66,8 +66,9 @@
       __set_errno (EINVAL);
       return -1;
     }
-
+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
   termios_p->c_ospeed = speed;
+#endif
   termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
   termios_p->c_cflag |= speed;

@@ -91,8 +92,9 @@
       __set_errno (EINVAL);
       return -1;
     }
-
+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
   termios_p->c_ispeed = speed;
+#endif
   if (speed == 0)
     termios_p->c_iflag |= IBAUD0;
   else
--- glibc-2.3.2/sysdeps/unix/sysv/linux/tcgetattr.c     2003-09-10 12:41:08.000000000 -0400
+++ glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcgetattr.c        2003-09-10 11:56:37.000000000 -0400
@@ -45,16 +45,20 @@
   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_STRUCT_TERMIOS_C_ISPEED
 #ifdef _HAVE_C_ISPEED
   termios_p->c_ispeed = k_termios.c_ispeed;
 #else
   termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
 #endif
+#endif
+#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED
 #ifdef _HAVE_C_OSPEED
   termios_p->c_ospeed = k_termios.c_ospeed;
 #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)
     memset (__mempcpy (&termios_p->c_cc[0], &k_termios.c_cc[0],
diff -ur -x objdir glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcsetattr.c
--- glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c     2003-09-10 12:41:08.000000000 -0400
+++ glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcsetattr.c        2003-09-10 11:56:42.000000000 -0400
@@ -71,12 +71,16 @@
   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_STRUCT_TERMIOS_C_ISPEED
 #ifdef _HAVE_C_ISPEED
   k_termios.c_ispeed = termios_p->c_ispeed;
 #endif
+#endif
+#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED
 #ifdef _HAVE_C_OSPEED
   k_termios.c_ospeed = termios_p->c_ospeed;
 #endif
+#endif
   memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
          __KERNEL_NCCS * sizeof (cc_t));


-- 
Life in itself has no meaning. 
Life is an opportunity to create meaning.

              \|/ ____ \|/ 
              "@'/ .. \`@" 
              /_| \__/ |_\ 
                 \__U_/ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]