Re: [PATCH 18/32] Only return two values in udevGetStringProperty

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

 



On Mon, Jun 06, 2016 at 11:01:55 +0200, Ján Tomko wrote:
> There is no need to differentiate between PROPERTY_FOUND
> and PROPERTY_MISSING - we can just look if the string is non-NULL.
> ---
>  src/node_device/node_device_udev.c | 87 ++++++++++++++++----------------------
>  1 file changed, 36 insertions(+), 51 deletions(-)
> 
> diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
> index 35d0dc7..876fca1 100644
> --- a/src/node_device/node_device_udev.c
> +++ b/src/node_device/node_device_udev.c
> @@ -90,9 +90,8 @@ static int udevGetStringProperty(struct udev_device *udev_device,
>  {
>      if (VIR_STRDUP(*value,
>                     udevGetDeviceProperty(udev_device, property_key)) < 0)
> -        return PROPERTY_ERROR;
> -
> -    return *value == NULL ? PROPERTY_MISSING : PROPERTY_FOUND;
> +        return -1;

Add a newline here.

> +    return 0;
>  }

ACK

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