mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-24 09:49:59 +03:00
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:
committed by
Martin Kletzander
parent
7e1208297d
commit
fa6805e55e
@ -71,9 +71,10 @@ static int virCgroupPartitionEscape(char **path);
|
|||||||
|
|
||||||
bool virCgroupAvailable(void)
|
bool virCgroupAvailable(void)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
|
#ifdef HAVE_GETMNTENT_R
|
||||||
FILE *mounts = NULL;
|
FILE *mounts = NULL;
|
||||||
struct mntent entry;
|
struct mntent entry;
|
||||||
bool ret = false;
|
|
||||||
char buf[CGROUP_MAX_VAL];
|
char buf[CGROUP_MAX_VAL];
|
||||||
|
|
||||||
if (!virFileExists("/proc/cgroups"))
|
if (!virFileExists("/proc/cgroups"))
|
||||||
@ -90,6 +91,7 @@ bool virCgroupAvailable(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_FORCE_FCLOSE(mounts);
|
VIR_FORCE_FCLOSE(mounts);
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user