c313de
From 05df743686ad42fa006877341b7719ff4a890a70 Mon Sep 17 00:00:00 2001
c313de
Message-Id: <05df743686ad42fa006877341b7719ff4a890a70@dist-git>
c313de
From: Pavel Hrdina <phrdina@redhat.com>
c313de
Date: Mon, 1 Jul 2019 17:07:09 +0200
c313de
Subject: [PATCH] vircgroup: include system headers only on linux
c313de
MIME-Version: 1.0
c313de
Content-Type: text/plain; charset=UTF-8
c313de
Content-Transfer-Encoding: 8bit
c313de
c313de
All the system headers are used only if we are compiling on linux
c313de
and they all are present otherwise we would have seen build errors
c313de
because in our tests/vircgrouptest.c we use only __linux__ to check
c313de
whether to skip the cgroup tests or not.
c313de
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c313de
(cherry picked from commit 6ef37ed3b8e7cc5fd83ff2b84bf08deea62d3bd0)
c313de
c313de
Conflicts:
c313de
    src/util/vircgroup.c - missing commits 9403b63102 5165ff0971
c313de
c313de
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
c313de
c313de
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c313de
Message-Id: <78f1905b381e5d9dce9daeabcf157e2fe65ddffe.1561993100.git.phrdina@redhat.com>
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
---
c313de
 src/util/vircgroup.c | 35 +++++++++++++++++------------------
c313de
 1 file changed, 17 insertions(+), 18 deletions(-)
c313de
c313de
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
c313de
index f1ecb1dbeb..a376b9b89a 100644
c313de
--- a/src/util/vircgroup.c
c313de
+++ b/src/util/vircgroup.c
c313de
@@ -23,28 +23,27 @@
c313de
  */
c313de
 #include <config.h>
c313de
 
c313de
-#include <stdio.h>
c313de
-#if defined HAVE_MNTENT_H && defined HAVE_SYS_MOUNT_H \
c313de
-    && defined HAVE_GETMNTENT_R
c313de
+#ifdef __linux__
c313de
+# include <stdio.h>
c313de
 # include <mntent.h>
c313de
 # include <sys/mount.h>
c313de
-#endif
c313de
-#include <fcntl.h>
c313de
-#include <string.h>
c313de
-#include <errno.h>
c313de
-#include <stdlib.h>
c313de
-#include <sys/stat.h>
c313de
+# include <fcntl.h>
c313de
+# include <string.h>
c313de
+# include <errno.h>
c313de
+# include <stdlib.h>
c313de
+# include <sys/stat.h>
c313de
 
c313de
-#ifdef MAJOR_IN_MKDEV
c313de
-# include <sys/mkdev.h>
c313de
-#elif MAJOR_IN_SYSMACROS
c313de
-# include <sys/sysmacros.h>
c313de
-#endif
c313de
+# ifdef MAJOR_IN_MKDEV
c313de
+#  include <sys/mkdev.h>
c313de
+# elif MAJOR_IN_SYSMACROS
c313de
+#  include <sys/sysmacros.h>
c313de
+# endif
c313de
 
c313de
-#include <sys/types.h>
c313de
-#include <signal.h>
c313de
-#include <dirent.h>
c313de
-#include <unistd.h>
c313de
+# include <sys/types.h>
c313de
+# include <signal.h>
c313de
+# include <dirent.h>
c313de
+# include <unistd.h>
c313de
+#endif /* __linux__ */
c313de
 
c313de
 #define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
c313de
 #include "vircgrouppriv.h"
c313de
-- 
c313de
2.22.0
c313de