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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]