[systemd-devel] [PATCH 3/5] tpmfiles: add missing parenthesis

Carlos Silva r3pek at r3pek.org
Sat Mar 2 06:55:05 PST 2013


On Sat, Mar 2, 2013 at 1:46 PM, Michal Sekletar <sekletar.m at gmail.com>wrote:

> >> -                        if (!i->type == IGNORE_DIRECTORY_PATH ||
> !streq(dent->d_name, p)) {
> >> +                        if (!(i->type == IGNORE_DIRECTORY_PATH ||
> !streq(dent->d_name, p))) {
> > After the change we have:
> >  if (i->type != I_D_P && streq(d_name, p))
>
> Agreed.
> >
> > Shouldn't we instead have
> >  if (i->type != I_D_P || strneq(d_name, p))
> > ?
> >
>
> I don't think so, because we want to get rid of directory, when item type
> is different from IGNORE_DIRECTORY_PATH or if we are processing item of
> type I_D_N, but directory names does not match. I *assume* that original
> behaviour is actually correct.
>

Thing is, you didn't kept original behaviour ;)

(!a || !b) == !(a && b) != !(a || !b)

or am I missing something here? ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130302/d45063e7/attachment.html>


More information about the systemd-devel mailing list