On Fri, Apr 29, 2011 at 11:42:05AM +0200, Karel Zak wrote: > On Thu, Apr 28, 2011 at 04:56:30PM +0200, Werner Fink wrote: > > Next cleanup, that is split off special character parsing in do_prompt() > > and parse_args(), handle name of line of virtual console and use it in > > utmp update as well as the session id. Also move the initial TERM > > variable to open_tty() as we use this later in open_tty(). > > Oh.. so many changes in one patch ;-( > > > +static ssize_t safe_write (int fd, const char *buffer, size_t count); > > Please, #include "widechar.h" where is already implemented this > function. Just read this header file but I've no idea on which function do you refer. > > > @@ -483,15 +462,29 @@ static void parse_args(int argc, char **argv, struct options *op) > > if ('0' <= argv[optind][0] && argv[optind][0] <= '9') { > > /* Assume BSD style speed. */ > > parse_speeds(op, argv[optind++]); > > - op->tty = argv[optind]; > > + if (argc < optind + 1) { > > + warn(_("not enough arguments")); > > + usage(stderr); > > + } > > + op->tty = argv[optind++]; > > } else { > > op->tty = argv[optind++]; > > - parse_speeds(op, argv[optind]); > > + if (argc > optind) { > > + char *v = argv[optind++]; > > + if ('0' <= *v && *v <= '9') > > + parse_speeds(op, v); > > + else > > + op->speeds[op->numspeed++] = bcode("9600"); > > + } > > } > > After this change the code does not make sense (and I will not apply > such block of code). It would be better to make the speed optional > and use some default speed there. The idea was to have the possiblity to use agetty without specifing a speed. > > > + if (c == '\\') > > + output_special_char(getc(fd), op, tp); > > + else > > + (void) putchar(c); > > Don't use (void), it's legacy with no effect. OK. Werner -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html