This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: A termios path
- To: drepper@cygnus.com
- Subject: Re: A termios path
- From: hjl@lucon.org (H.J. Lu)
- Date: Tue, 8 Dec 1998 08:12:00 -0800 (PST)
- Cc: libc-hacker@cygnus.com
> - if cfsetospeed I clear the bit. Otherwise the behaviour is inconsistent.
> If I set ispeed and then ospeed on a system where only one speed is
> available the later overwrites the former. The special have zero
> shouldn't be an exception.
>
I don't think that is correct. Set the input speed to 0 doesn't take
effect until tcsetattr is called. That means cfgetispeed should still
return 0 before tcsetattr is called. Here is a new patch.
Thanks.
--
H.J. Lu (hjl@gnu.org)
-----
Tue Dec 8 07:47:03 1998 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Don't clear
the IBAUD0 bit in c_iflag.
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Clear the
the IBAUD0 bit in c_iflag.
Index: sysdeps/unix/sysv/linux/speed.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/speed.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 speed.c
--- speed.c 1998/12/08 15:32:22 1.1.1.3
+++ speed.c 1998/12/08 15:45:54
@@ -66,7 +66,6 @@ cfsetospeed (termios_p, speed)
return -1;
}
- termios_p->c_iflag &= ~IBAUD0;
termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
termios_p->c_cflag |= speed;
Index: sysdeps/unix/sysv/linux/tcsetattr.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/tcsetattr.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 tcsetattr.c
--- tcsetattr.c 1998/12/08 15:32:23 1.1.1.4
+++ tcsetattr.c 1998/12/08 15:45:43
@@ -73,7 +73,9 @@ tcsetattr (fd, optional_actions, termios
return -1;
}
- k_termios.c_iflag = termios_p->c_iflag & ~IBAUD0;
+ termios_p->c_iflag &= ~IBAUD0;
+
+ k_termios.c_iflag = termios_p->c_iflag;
k_termios.c_oflag = termios_p->c_oflag;
k_termios.c_cflag = termios_p->c_cflag;
k_termios.c_lflag = termios_p->c_lflag;