Re: [PATCH 2/8] Next cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 29, 2011 at 03:05:15PM +0200, Karel Zak wrote:
> 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:
> > > 
> > >  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 ;-)

OK found write_all() ... also found EAGAIN therein, AFAICR back
on writing code for VDR the errno EAGAIN could be without using
an usleep() a few ms somehow like DOS attack as the kernel may
repeat EAGAIN very often on special devices :)

> > > > @@ -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)

Yep, this was what I've learned by replacing mingetty
here with the agetty for tests :]

    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


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux