Re: [hackers] [ubase][PATCH] hwclock: [-rsw] => (-r | -s | -w) and fix flag check

From: Mattias Andrée <maandree_AT_kth.se>
Date: Fri, 22 Apr 2016 11:45:44 +0200

On Fri, 22 Apr 2016 10:01:18 +0200
Hiltjo Posthuma <hiltjo_AT_codemadness.org> wrote:

> On Fri, Apr 22, 2016 at 03:24:47AM +0200, Mattias Andrée
> wrote:
> > Also in man page: [-r | -s | -w] => (-r | -s | -w)
> >
> > 8< ... snippity snip ...>8
> >
> > int
> > _AT_@ -141,7 +141,7 @@ main(int argc, char *argv[])
> > else if (argc == 1)
> > dev = argv[0];
> >
> > - if ((rflag ^ sflag ^ wflag) == 0)
> > + if (rflag + sflag + wflag != 1)
> > eprintf("missing or incompatible
> > function\n");
>
> This is not the same in behaviour. Is it intended? I
> think the patch makes sense though.

Yes, this is intended. I believe it must have been meant
that exactly one of them must be used, not either zero
of two of them.

>
> Thanks for the patches,
>
> Kind regards,
> Hiltjo
>


Received on Fri Apr 22 2016 - 11:45:44 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 22 2016 - 11:48:15 CEST