[libvirt] [PATCHv2 1/2] util: Don't fail virGetUserIDByName when user not found

Eric Blake eblake at redhat.com
Thu Dec 6 21:47:09 UTC 2012


On 12/06/2012 09:01 AM, Peter Krempa wrote:
> On 12/06/12 15:37, Christophe Fergeau wrote:
>> virGetUserIDByName is documented as returning 1 if the username
>> cannot be found. getpwnam_r is documented as returning:
>> « 0 or ENOENT or ESRCH or EBADF or EPERM or ...  The given name
>> or uid was not found. »

>> +       if ((rc == EINTR) || (rc == EIO) || (rc == EMFILE)
>> +           || (rc == ENFILE) || (rc == ENOMEM)) {
> 
> We usualy write the operator at the end of the previous line of a
> linebreak.
> 

Also (although I'm a bit late to the review, since you've already
pushed), we don't use extra () when not needed.  That is:

if (rc == EINTR || rc == EIO || ...)

is just fine, without having to bracket each branch of the conditional.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121206/c148ba35/attachment-0001.sig>


More information about the libvir-list mailing list