render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
ad1c90
From 06e0a9d40c52736919f32578f926bf4d829e77ec Mon Sep 17 00:00:00 2001
ad1c90
Message-Id: <06e0a9d40c52736919f32578f926bf4d829e77ec@dist-git>
ad1c90
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
ad1c90
Date: Mon, 27 Jul 2020 12:36:49 +0200
ad1c90
Subject: [PATCH] src: assume sys/sysmacros.h always exists on Linux
ad1c90
MIME-Version: 1.0
ad1c90
Content-Type: text/plain; charset=UTF-8
ad1c90
Content-Transfer-Encoding: 8bit
ad1c90
ad1c90
All our supported Linux distros now have this header.
ad1c90
It has never existed on FreeBSD / macOS / Mingw.
ad1c90
ad1c90
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
ad1c90
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
ad1c90
(cherry picked from commit 03c532cf9711dd6ad35380455a77141ef7d492ab)
ad1c90
ad1c90
https://bugzilla.redhat.com/show_bug.cgi?id=1860421
ad1c90
ad1c90
Conflicts:
ad1c90
- src/util/virutil.c - context, because
ad1c90
  db72866310d1e520efa8ed2d4589bdb5e76a1c95 (util: add API for
ad1c90
  reading password from the console) isn't backported.
ad1c90
ad1c90
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ad1c90
Message-Id: <ec98419d1aaa478bd3ac7a41aa9cb8b316695ef9.1595846084.git.mprivozn@redhat.com>
ad1c90
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
ad1c90
---
ad1c90
 src/conf/domain_audit.c  | 4 +---
ad1c90
 src/lxc/lxc_controller.c | 4 +---
ad1c90
 src/lxc/lxc_driver.c     | 4 +---
ad1c90
 src/qemu/qemu_domain.c   | 4 +---
ad1c90
 src/util/vircgroup.c     | 8 +-------
ad1c90
 src/util/virdevmapper.c  | 4 +---
ad1c90
 src/util/virutil.c       | 4 +---
ad1c90
 tests/vircgroupmock.c    | 8 +-------
ad1c90
 8 files changed, 8 insertions(+), 32 deletions(-)
ad1c90
ad1c90
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
ad1c90
index fdccc585fb..6d3579e0f6 100644
ad1c90
--- a/src/conf/domain_audit.c
ad1c90
+++ b/src/conf/domain_audit.c
ad1c90
@@ -23,9 +23,7 @@
ad1c90
 
ad1c90
 #include <sys/stat.h>
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 
ad1c90
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
ad1c90
index 42c631ed0b..0da89dba89 100644
ad1c90
--- a/src/lxc/lxc_controller.c
ad1c90
+++ b/src/lxc/lxc_controller.c
ad1c90
@@ -25,9 +25,7 @@
ad1c90
 #include <sys/wait.h>
ad1c90
 #include <sys/socket.h>
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 
ad1c90
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
ad1c90
index 780c6ed4a2..a8c93dd228 100644
ad1c90
--- a/src/lxc/lxc_driver.c
ad1c90
+++ b/src/lxc/lxc_driver.c
ad1c90
@@ -25,9 +25,7 @@
ad1c90
 #include <sched.h>
ad1c90
 #include <sys/utsname.h>
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 
ad1c90
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
ad1c90
index 1e968368ae..ffe88ff027 100644
ad1c90
--- a/src/qemu/qemu_domain.c
ad1c90
+++ b/src/qemu/qemu_domain.c
ad1c90
@@ -64,9 +64,7 @@
ad1c90
 #include "backup_conf.h"
ad1c90
 #include "virdevmapper.h"
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 #include <sys/time.h>
ad1c90
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
ad1c90
index dff2f6fd3a..a45c2e7f2f 100644
ad1c90
--- a/src/util/vircgroup.c
ad1c90
+++ b/src/util/vircgroup.c
ad1c90
@@ -25,13 +25,7 @@
ad1c90
 # include <sys/mount.h>
ad1c90
 # include <fcntl.h>
ad1c90
 # include <sys/stat.h>
ad1c90
-
ad1c90
-# ifdef MAJOR_IN_MKDEV
ad1c90
-#  include <sys/mkdev.h>
ad1c90
-# elif MAJOR_IN_SYSMACROS
ad1c90
-#  include <sys/sysmacros.h>
ad1c90
-# endif
ad1c90
-
ad1c90
+# include <sys/sysmacros.h>
ad1c90
 # include <sys/types.h>
ad1c90
 # include <signal.h>
ad1c90
 # include <dirent.h>
ad1c90
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
ad1c90
index c346432d86..40a82285f9 100644
ad1c90
--- a/src/util/virdevmapper.c
ad1c90
+++ b/src/util/virdevmapper.c
ad1c90
@@ -20,9 +20,7 @@
ad1c90
 
ad1c90
 #include <config.h>
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 
ad1c90
diff --git a/src/util/virutil.c b/src/util/virutil.c
ad1c90
index 17fd06dbb2..5e6bbb37c0 100644
ad1c90
--- a/src/util/virutil.c
ad1c90
+++ b/src/util/virutil.c
ad1c90
@@ -28,9 +28,7 @@
ad1c90
 #include <poll.h>
ad1c90
 #include <sys/stat.h>
ad1c90
 
ad1c90
-#ifdef MAJOR_IN_MKDEV
ad1c90
-# include <sys/mkdev.h>
ad1c90
-#elif MAJOR_IN_SYSMACROS
ad1c90
+#ifdef __linux__
ad1c90
 # include <sys/sysmacros.h>
ad1c90
 #endif
ad1c90
 
ad1c90
diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
ad1c90
index 9ec3b576d2..66b8c01852 100644
ad1c90
--- a/tests/vircgroupmock.c
ad1c90
+++ b/tests/vircgroupmock.c
ad1c90
@@ -23,13 +23,7 @@
ad1c90
 # include <unistd.h>
ad1c90
 # include <fcntl.h>
ad1c90
 # include <sys/stat.h>
ad1c90
-
ad1c90
-# ifdef MAJOR_IN_MKDEV
ad1c90
-#  include <sys/mkdev.h>
ad1c90
-# elif MAJOR_IN_SYSMACROS
ad1c90
-#  include <sys/sysmacros.h>
ad1c90
-# endif
ad1c90
-
ad1c90
+# include <sys/sysmacros.h>
ad1c90
 # include <stdarg.h>
ad1c90
 # include "testutilslxc.h"
ad1c90
 # include "virstring.h"
ad1c90
-- 
ad1c90
2.28.0
ad1c90