On Fri, Apr 29, 2011 at 02:34:13PM +0200, Dr. Werner Fink wrote: > 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. Ah... copy & past error, include/writeall.h ;-) > > > @@ -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. Yes, I understand, but you have to remove if (argc < optind + 2) from the code. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- 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