Re: [PATCH] Fix virCgroupAvailable() w/o HAVE_GETMNTENT_R defined

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

 



On 07/24/2013 02:30 PM, Roman Bogorodskiy wrote:
> virCgroupAvailable() implementation calls getmntent_r
> without checking if HAVE_GETMNTENT_R is defined, so it fails
> to build on platforms without getmntent_r support.
> 
> Make virCgroupAvailable() just return false without
> HAVE_GETMNTENT_R.
> ---
>  src/util/vircgroup.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
> index 5251611..d328212 100644
> --- a/src/util/vircgroup.c
> +++ b/src/util/vircgroup.c
> @@ -69,9 +69,10 @@ typedef enum {
>  
>  bool virCgroupAvailable(void)
>  {
> +    bool ret = false;
> +#ifdef HAVE_GETMNTENT_R
>      FILE *mounts = NULL;
>      struct mntent entry;
> -    bool ret = false;
>      char buf[CGROUP_MAX_VAL];
>  
>      if (!virFileExists("/proc/cgroups"))
> @@ -88,6 +89,7 @@ bool virCgroupAvailable(void)
>      }
>  
>      VIR_FORCE_FCLOSE(mounts);
> +#endif
>      return ret;
>  }
>  

ACKed and pushed.

Martin

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