This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: last changes and problems
- To: hjl@lucon.org (H.J. Lu)
- Subject: Re: last changes and problems
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 16 Dec 1998 08:17:19 +0100
- Cc: drepper@cygnus.com, libc-hacker@cygnus.com
- Mail-Copies-To: never
- References: <m0zpF7e-00038tC@ocean.lucon.org>
>>>>> H J Lu writes:
>>
>> Hi,
>>
>> I think I've checked in all the changes I got. If you find something
>> missing please resubmit the patch.
>>
HJ> What happened to this? As I said, Setting the input baud rate to the
HJ> output baud rate by the 0 input baud rate only happens when the call
HJ> to tcsetattr is made. My patch fixes it.
HJ> Thanks.
HJ> H.J.
HJ> ---
HJ> Tue Dec 8 07:47:03 1998 H.J. Lu <hjl@gnu.org>
HJ> * sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Don't clear
HJ> the IBAUD0 bit in c_iflag.
HJ> * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Clear the
HJ> the IBAUD0 bit in c_iflag.
HJ> Index: sysdeps/unix/sysv/linux/tcsetattr.c
HJ> ===================================================================
HJ> RCS file: /home/work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/tcsetattr.c,v
HJ> retrieving revision 1.1.1.4
HJ> diff -u -r1.1.1.4 tcsetattr.c
HJ> --- tcsetattr.c 1998/12/08 15:32:23 1.1.1.4
HJ> +++ tcsetattr.c 1998/12/08 15:50:39
HJ> @@ -73,7 +73,9 @@
HJ> return -1;
HJ> }
HJ> - k_termios.c_iflag = termios_p->c_iflag & ~IBAUD0;
HJ> + termios_p->c_iflag &= ~IBAUD0;
HJ> +
HJ> + k_termios.c_iflag = termios_p->c_iflag;
HJ> k_termios.c_oflag = termios_p->c_oflag;
HJ> k_termios.c_cflag = termios_p->c_cflag;
HJ> k_termios.c_lflag = termios_p->c_lflag;
You're setting a read only variable (const struct termios *termios_p)
here:
termios_p->c_iflag &= ~IBAUD0;
The following patch should achieve the same but doesn't manipulate
*termios_p. Or do you really want to change the parameter?
Andreas
1998-12-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Don't change
read-only struct termios_p* but change k_termios member directly.
--- sysdeps/unix/sysv/linux/tcsetattr.c.~1~ Tue Dec 15 07:06:30 1998
+++ sysdeps/unix/sysv/linux/tcsetattr.c Wed Dec 16 08:12:50 1998
@@ -73,9 +73,7 @@
return -1;
}
- termios_p->c_iflag &= ~IBAUD0;
-
- k_termios.c_iflag = termios_p->c_iflag;
+ k_termios.c_iflag = termios_p->c_iflag & ~IBAUD0;
k_termios.c_oflag = termios_p->c_oflag;
k_termios.c_cflag = termios_p->c_cflag;
k_termios.c_lflag = termios_p->c_lflag;
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de