> On Dec 18, 2018, at 3:07 PM, Ian Jackson <ian.jack...@citrix.com> wrote:
> 
>> If we switch the earlier `return 0` in the !dm_restrict conditional to a 
>> “goto out”, then this would turn into:
> 
> I think setting intended_uid==0 when user==0 is a hostage to fortune.
> Why not set it to (uid_t)-1 ?
> 
> Then you write:
> 
>  if (!rc) {
>     if (intended_uid == 0) {
>         complain
>         rc = ERROR_INVAL;
>     }
>  }
>  if (!rc) {
>     save user and intended_uid
>  }
> 
>> If you have a favorite color it might be better just to tell me. :-)
> 
> Do you see why I prefer the above ?

Not at all I’m afraid.  Especially now that we have two separate “if (!rc)” 
checks,  I think having an extra label to jump to when we know the check needs 
to be done makes the code both more aesthetically pleasing and easier to 
understand.  But it’s your house, if you want it orange and purple, that’s what 
color I’ll paint it. :-)

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to