[libvirt] [PATCH] util: distinguish get{pw|gr}nam_r error from the "not found" cases
Guannan Ren
gren at redhat.com
Fri Mar 8 02:34:59 UTC 2013
On 03/08/2013 12:10 AM, Peter Krempa wrote:
> On 03/07/13 17:08, Guannan Ren wrote:
>> manpage:
>> "If no matching record was found, these functions return 0 and
>> store NULL in *result. In case of error, an error number is returned,
>> and NULL is stored in *result."
>>
>> So we can distinguish function error from "no found" cases based on
>> the return value.
>> ---
>> src/util/virutil.c | 46 ++++++++++++++++++++++++----------------------
>> 1 file changed, 24 insertions(+), 22 deletions(-)
>
> NACK, we already tried that, but getpwnam_r sucks and there's no
> reasonable replacement.
>
> See
> http://www.redhat.com/archives/libvir-list/2012-December/msg00207.html
> for the full reasons we stick with the ugly code.
>
> Peter
Accept the nack :)
More information about the libvir-list
mailing list