]> xenbits.xensource.com Git - libvirt.git/commitdiff
cgroup: don't include sys/mount.h if not needed
authorJasper Lievisse Adriaanse <jasper@openbsd.org>
Thu, 7 Jan 2016 18:41:52 +0000 (21:41 +0300)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 11 Jan 2016 16:56:06 +0000 (19:56 +0300)
As cgroup implementation only works on Linux, it does not
make much sense to include sys/mount.h if other requirements are
not met, such as HAVE_MNTENT_H and HAVE_GETMNTENT_R.

Also, it fixes build on OpenBSD that requires to include sys/param.h
along with sys/mount.h.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
src/util/vircgroup.c

index e39c4d1ab3819f862da58ab0c095e838a6514b4d..78f519c2c2aae828d80b5c98d35520b799d826a5 100644 (file)
 #include <config.h>
 
 #include <stdio.h>
-#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
+#if defined HAVE_MNTENT_H && defined HAVE_SYS_MOUNT_H \
+    && defined HAVE_GETMNTENT_R
 # include <mntent.h>
-#endif
-#if defined HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
 #endif
 #include <fcntl.h>