On Sunday 04 November 2007, Samuel Thibault wrote: > Mike Frysinger, le Sat 11 Aug 2007 22:48:43 -0400, a écrit : > > i think everything should use termios functions. these are a POSIX > > standard and the underlying hacks and what not are the libc's problem, > > not util-linux. > > Ok, here is a patch. thanks ! > void termio_init(tp, speed, op) > > - tp->c_cflag = CS8 | HUPCL | CREAD | speed; > + tp->c_cflag = CS8 | HUPCL | CREAD; > + cfsetispeed(tp, speed); > + cfsetospeed(tp, speed); > if (op->flags & F_LOCAL) { > tp->c_cflag |= CLOCAL; > } > > - tp->c_iflag = tp->c_lflag = tp->c_oflag = tp->c_line = 0; > + tp->c_iflag = tp->c_lflag = tp->c_oflag = 0; > +#ifndef __GNU__ > + tp->c_line = 0; > +#endif > tp->c_cc[VMIN] = 1; > tp->c_cc[VTIME] = 0; since we fully initialize the termios struct, it may be cleaner to just do this at the start of the function: memset(&tp, 0, sizeof(tp)); then we wont need #ifdef's to figure out what struct members exist > @@ -1179,7 +1154,9 @@ termio_final(op, tp, cp) > > if (cp->capslock) { > tp->c_iflag |= IUCLC; > +#ifdef XCASE > tp->c_lflag |= XCASE; > +#endif > tp->c_oflag |= OLCUC; > } > /* Optionally enable hardware flow control */ XCASE isnt in POSIX anymore and from the man page, says it doesnt even work on Linux, so how about just dropping this completely ? -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.