]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix virCgroupAvailable() w/o HAVE_GETMNTENT_R defined
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 24 Jul 2013 12:30:33 +0000 (16:30 +0400)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 24 Jul 2013 13:31:34 +0000 (15:31 +0200)
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

index aea2b4de4bcb06a9779f8086504072107175685d..9727a3e2b5870231746040162f210b5e7bd1ba87 100644 (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;
 }