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.
This commit is contained in:
Roman Bogorodskiy 2013-07-24 16:30:33 +04:00 committed by Martin Kletzander
parent 7e1208297d
commit fa6805e55e

View File

@ -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;
}