Re: [PATCH 2/4] flock: cleanup usage issues

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

 



On Mon, Jun 19, 2017 at 04:40:14PM +0200, Ruediger Meier wrote:
> On Monday 19 June 2017, Ruediger Meier wrote:
> > On Monday 19 June 2017, Karel Zak wrote:
> > > On Mon, Jun 19, 2017 at 02:36:17PM +0200, Ruediger Meier wrote:
> > > > Sorry I forgot that the fputs/puts repacement adds another
> > > > newline.
> > > >
> > > > I could either
> > > >   1. remove the newlines from the strings (but would this cause
> > > > extra work for translators?)
> > > >   2. use printf instead of puts
> > > >   3. don't change anything, just use constant FILE argument
> > > > stdout.
> > >
> > > I think fputs(..., stdout) is non-invasive change, better than
> > > modify all strings and probably more effective than printf().
> > >
> > >     Karel
> >
> > I'm using
> >
> > -static void usage(FILE * out) {
> > -    FILE * out = stdout;
> > -    fputs(USAGE_HEADER, out);
> > +static void usage(void) {
> > +    FILE * out = stdout;
> > +    fputs(USAGE_HEADER, out);
> >     ...
> > }
> 
> Sorry I mean this 
> 
> -static void usage(FILE * out) {
> +static void usage(void) {
> +    FILE * out = stdout;
>      fputs(USAGE_HEADER, out);
>      ...
> }

Yes, seems good, but I sure one day someone will ask: 

    what the hell are you doing with "out = stdout;" ?

:-)

    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



[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