mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +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:
parent
7e1208297d
commit
fa6805e55e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user