Re: [PATCH] network: fix return value of hostsFileWrite

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

 



On 04/28/2011 12:28 AM, Laine Stump wrote:
> The lone caller to hostsFileWrite (and the callers for at least 3
> levels up the return stack) assume that the return value will be < 0
> on failure. However, hostsFileWrite returns 0 on success, and a
> positive errno on failure. This patch changes hostsFileWrite to return
> -errno on failure.
> ---
>  src/util/dnsmasq.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
> index be230e1..2ba9355 100644
> --- a/src/util/dnsmasq.c
> +++ b/src/util/dnsmasq.c
> @@ -159,19 +159,19 @@ hostsfileWrite(const char *path,
>          return rc;

I had to check context, but here rc is 0 so it is safe.

All other lines in the patch are correct.

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]