From: Roman Bogorodskiy Date: Wed, 24 Jul 2013 12:30:33 +0000 (+0400) Subject: Fix virCgroupAvailable() w/o HAVE_GETMNTENT_R defined X-Git-Tag: v1.1.1-rc2~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa6805e55e226cf7800bd5940dcaea4dd863b18b;p=thirdparty%2Flibvirt.git Fix virCgroupAvailable() w/o HAVE_GETMNTENT_R defined 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. --- diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index aea2b4de4b..9727a3e2b5 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -71,9 +71,10 @@ static int virCgroupPartitionEscape(char **path); 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")) @@ -90,6 +91,7 @@ bool virCgroupAvailable(void) } VIR_FORCE_FCLOSE(mounts); +#endif return ret; }