On Monday 17 December 2007, Samuel Thibault wrote: > Mike Frysinger, le Sun 04 Nov 2007 15:24:59 -0400, a écrit : > > On Sunday 04 November 2007, Samuel Thibault wrote: > > > 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 > > Here is an updated patch: > > Migrate to standard POSIX termios structures and functions. i thought you pointed out that POSIX does not allow for my memset() suggestion ? i dont recall the location, but you'd found a part of the standard that said conforming applications must leave unknown fields alone ? -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.