render / rpms / libvirt

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