Re: [libvirt] [PATCH] fix mingw compilation warning

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

 



Jim Meyering <jim@xxxxxxxxxxxx> wrote:
> Building for mingw, I got this warning:
>
>     libvirt.c:242: warning: control reaches end of non-void function
>
> Here's the fix:
>
>     fix mingw compilation warning
>     * src/libvirt.c (winsock_init) [HAVE_WINSOCK2_H]: Always return a value.
>
> diff --git a/src/libvirt.c b/src/libvirt.c
> index ca2675a..05a92d3 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -237,8 +237,7 @@ winsock_init (void)
>      /* http://msdn2.microsoft.com/en-us/library/ms742213.aspx */
>      winsock_version = MAKEWORD (2, 2);
>      err = WSAStartup (winsock_version, &winsock_data);
> -    if (err != 0)
> -        return -1;
> +    return err == 0 ? 0 : -1;
>  }
>  #endif

Committed.

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