Subject: Re: commoning up code that changes uids and gids
To: Jaromir Dolecek <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 04/05/2003 19:35:53
> > Seeing as this did cause more confusion that it's worth, could you
> > just add a couple of parenthesis. E.g;
> > svuid = (ruid == p->p_cred->p_ruid ? -1 : euid);
> > or
> > svuid = (ruid == p->p_cred->p_ruid) ? -1 : euid;
That use of () is particularly misleading, for instance how would you
svuid = 1 + (ruid == p->p_cred->p_ruid) ? -1 : euid;
> Ouch, thanks Luke for pointing out the obvious. I thought there
> is single '=' there ...
No I rarely put assignments inside expressions, it is a waste of
> I've committed change to use the latter form (var = (check) ? x : y)
> in there.
And I'm tempted to back it straight out!
David Laight: firstname.lastname@example.org