[libvirt] [PATCH] cgroup: Fix compilation broken on MinGW due to dirent->d_type

Ryota Ozaki ozaki.ryota at gmail.com
Wed Jun 30 12:00:00 UTC 2010


On Wed, Jun 30, 2010 at 8:49 PM, Ryota Ozaki <ozaki.ryota at gmail.com> wrote:
> As pointed out by Eric Blake, using dirent->d_type breaks
> compilation on MinGW. This patch addresses this by using
> '#if defined' as same as doing for virCgroupForDriver.

Note that I didn't test this patch because I don't have Windows/MinGW
environment
and fails to cross-compile on Linux for some reason. So please test
before applying
the patch.

Thanks
  ozaki-r


> ---
>  src/util/cgroup.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/src/util/cgroup.c b/src/util/cgroup.c
> index 9fa64dc..024036a 100644
> --- a/src/util/cgroup.c
> +++ b/src/util/cgroup.c
> @@ -608,6 +608,7 @@ cleanup:
>  }
>  #endif
>
> +#if defined _DIRENT_HAVE_D_TYPE
>  static int virCgroupRemoveRecursively(char *grppath)
>  {
>     DIR *grpdir;
> @@ -656,6 +657,13 @@ static int virCgroupRemoveRecursively(char *grppath)
>
>     return rc;
>  }
> +#else
> +static int virCgroupRemoveRecursively(char *grppath ATTRIBUTE_UNUSED)
> +{
> +    /* Claim no support */
> +    return -ENXIO;
> +}
> +#endif
>
>  /**
>  * virCgroupRemove:
> --
> 1.6.5.2
>
>




More information about the libvir-list mailing list