Subject: Re: commoning up code that changes uids and gids
To: David Laight <david@l8s.co.uk>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 04/05/2003 21:49:07
David Laight wrote:
> > > 	svuid = (ruid == p->p_cred->p_ruid) ? -1 : euid;
> 
> That use of () is particularly misleading,

Eh, misleading?

> for instance how would you
> read:
>  	svuid = 1 + (ruid == p->p_cred->p_ruid) ? -1 : euid;
 
In the first place, I'd write this as

   	svuid = 1 + ((ruid == p->p_cred->p_ruid) ? -1 : euid);

and thus would not have any problem reading it. Parenthesis good.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-