[libvirt] [PATCH] virGet{User, Group}Ent() don't say success on fail
Eric Blake
eblake at redhat.com
Wed Sep 4 16:57:24 UTC 2013
On 09/04/2013 10:48 AM, Doug Goldstein wrote:
> When virGetUserEnt() and virGetGroupEnt() fail due to the uid or gid not
> existing on the machine they'll print a message like:
>
> $ virsh -c vbox:///session list
> error: failed to connect to the hypervisor
> error: Failed to find user record for uid '32655': Success
>
> The success at the end is a bit confusing. This changes it to:
>
> $ virsh -c vbox:///session list
> error: failed to connect to the hypervisor
> error: Failed to find user record for uid '32655'
> ---
> src/util/virutil.c | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
Hmm, I wonder if a better fix would be teaching virReportSystemError to
not append strerror(0) when the errno argument is 0; but that's liable
to paper over more abuses unless we audit all callers, which I don't
particularly want to do right now.
So ACK as-is.
--
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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130904/abf4d67f/attachment-0001.sig>
More information about the libvir-list
mailing list