Re: [PATCH] util: rework error reporting in virGet(User|Group)IDByName

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

 



On 12/11/12 21:30, Peter Krempa wrote:

>      if (!pw) {
> -        VIR_DEBUG("User record for user '%s' does not exist", name);
> +        if (rc != 0) {
> +            char buf[1024];
> +            /* log the possible error from getpwnam_r. Unfortunately error
> +             * reporting from this function is bad and we can't really
> +             * rely on it, so we just report that the user wasn't found */
> +            VIR_WARN("User record for user '%s' does was not found: %s",

s/does was/was/

> +                     name, virStrerror(rc, buf, sizeof(buf)));
> +        }

...

> +        if (rc != 0) {
> +            char buf[1024];
> +            /* log the possible error from getgrnam_r. Unfortunately error
> +             * reporting from this function is bad and we can't really
> +             * rely on it, so we just report that the user wasn't found */
> +            VIR_WARN("Group record for user '%s' does was not found: %s",

here too

> +                     name, virStrerror(rc, buf, sizeof(buf)));
> +        }
> +
>          ret = 1;
>          goto cleanup;
>      }

--
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]