From 05df743686ad42fa006877341b7719ff4a890a70 Mon Sep 17 00:00:00 2001 Message-Id: <05df743686ad42fa006877341b7719ff4a890a70@dist-git> From: Pavel Hrdina Date: Mon, 1 Jul 2019 17:07:09 +0200 Subject: [PATCH] vircgroup: include system headers only on linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Pavel Hrdina (cherry picked from commit 6ef37ed3b8e7cc5fd83ff2b84bf08deea62d3bd0) Conflicts: src/util/vircgroup.c - missing commits 9403b63102 5165ff0971 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297 Signed-off-by: Pavel Hrdina Message-Id: <78f1905b381e5d9dce9daeabcf157e2fe65ddffe.1561993100.git.phrdina@redhat.com> Reviewed-by: Ján Tomko --- src/util/vircgroup.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index f1ecb1dbeb..a376b9b89a 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -23,28 +23,27 @@ */ #include -#include -#if defined HAVE_MNTENT_H && defined HAVE_SYS_MOUNT_H \ - && defined HAVE_GETMNTENT_R +#ifdef __linux__ +# include # include # include -#endif -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include -#ifdef MAJOR_IN_MKDEV -# include -#elif MAJOR_IN_SYSMACROS -# include -#endif +# ifdef MAJOR_IN_MKDEV +# include +# elif MAJOR_IN_SYSMACROS +# include +# endif -#include -#include -#include -#include +# include +# include +# include +# include +#endif /* __linux__ */ #define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__ #include "vircgrouppriv.h" -- 2.22.0