[libvirt] [PATCH 2/2] virutil: fix MinGW build

Ján Tomko jtomko at redhat.com
Tue Feb 3 14:54:26 UTC 2015


On Tue, Feb 03, 2015 at 02:27:35PM +0100, Pavel Hrdina wrote:
> Commit b38da584 introduced two new functions to get a page size but it
> won't work on Windows. We should take care of this.
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/util/virutil.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/util/virutil.c b/src/util/virutil.c
> index c905209..06e608d 100644
> --- a/src/util/virutil.c
> +++ b/src/util/virutil.c
> @@ -2578,10 +2578,18 @@ virGetListenFDs(void)
>  
>  #endif /* WIN32 */
>  
> +#ifndef WIN32
>  long virGetSystemPageSize(void)
>  {
>      return sysconf(_SC_PAGESIZE);
>  }
> +#else /* WIN32 */
> +long virGetSystemPageSize(void)
> +{
> +    virReportSystemError(ENOSYS, "%s", _("Not supported on this platform"));

The non-win32 version of this does not set a libvirt error, so
errno = ENOSYS;
should be enough.

But the function won't get executed anyway.

ACK

Jan

> +    return -1;
> +}
> +#endif /* WIN32 */
>  
>  long virGetSystemPageSizeKB(void)
>  {
> -- 
> 2.0.5
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150203/bb2fea65/attachment-0001.sig>


More information about the libvir-list mailing list