]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircgroup: include system headers only on linux
authorPavel Hrdina <phrdina@redhat.com>
Thu, 27 Sep 2018 10:19:17 +0000 (12:19 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 27 Sep 2018 11:08:37 +0000 (13:08 +0200)
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.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/util/vircgroup.c

index 7700a9f7a7a42935a667cd7b19a624fc0e76ff71..f90906e4add140bef5adf5c3a7c2370974fa4e6d 100644 (file)
  */
 #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>
-
-#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 <fcntl.h>
+# include <sys/stat.h>
+
+# 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>
+#endif /* __linux__ */
 
 #define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
 #include "vircgrouppriv.h"