[PATCH v3 2/3] vircgroup: include system headers only on linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All the system headers are used only if we are compiling on linux
and they all are present otherwise we would have seen build errors
because in our tests/vircgrouptest.c we use only __linux__ to check
whether to skip the cgroup tests or not.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/util/vircgroup.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 7700a9f7a7..f90906e4ad 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -23,24 +23,23 @@
  */
 #include <config.h>
 
-#if defined HAVE_MNTENT_H && defined HAVE_SYS_MOUNT_H \
-    && defined HAVE_GETMNTENT_R
+#ifdef __linux__
 # include <mntent.h>
 # include <sys/mount.h>
-#endif
-#include <fcntl.h>
-#include <sys/stat.h>
+# include <fcntl.h>
+# include <sys/stat.h>
 
-#ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#elif MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-#endif
+# ifdef MAJOR_IN_MKDEV
+#  include <sys/mkdev.h>
+# elif MAJOR_IN_SYSMACROS
+#  include <sys/sysmacros.h>
+# endif
 
-#include <sys/types.h>
-#include <signal.h>
-#include <dirent.h>
-#include <unistd.h>
+# include <sys/types.h>
+# include <signal.h>
+# include <dirent.h>
+# include <unistd.h>
+#endif /* __linux__ */
 
 #define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
 #include "vircgrouppriv.h"
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux