Remove many imports of sys/ioctl.h which are redundant,
and conditionalize remaining usage that needs to compile
on Windows platforms.
The previous change to remove the "nonblocking" gnulib
module indirectly caused the loss of the "ioctl" gnulib
module that we did not explicitly list in bootstrap.conf
despite relying on.
Rather than re-introduce the "ioctl" module this patch
makes it redundant.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/util/virhostcpu.c | 4 +++-
src/util/virhostdev.c | 1 -
src/util/virhostmem.c | 1 -
src/util/virnetdev.c | 4 +++-
src/util/virnetdevbridge.c | 4 +++-
src/util/virnetdevip.c | 4 +++-
src/util/virnetdevtap.c | 4 +++-
src/util/virperf.c | 4 +++-
src/util/virvsock.c | 4 +++-
9 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index f9d5db59b9..0bde532a0c 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -24,7 +24,9 @@
#include <dirent.h>
#include <sys/utsname.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <unistd.h>
#if HAVE_LINUX_KVM_H
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 9b4ea30216..f8f7989206 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index 9c08b9bd78..f37d1ad588 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -23,7 +23,6 @@
#include <sys/utsname.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <unistd.h>
#if defined(__FreeBSD__) || defined(__APPLE__)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e2aad07c24..b896a7507e 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -31,7 +31,9 @@
#include "virutil.h"
#include "virjson.h"
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index a37bcb4004..5bb533f1f0 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -27,7 +27,9 @@
#include "virlog.h"
#include "virstring.h"
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 5696bc367e..5897c4aa76 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -33,7 +33,9 @@
# include <ifaddrs.h>
#endif
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 6a16b58d60..8656e267cb 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -33,7 +33,9 @@
#include <unistd.h>
#include <sys/types.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
#ifdef __linux__
diff --git a/src/util/virperf.c b/src/util/virperf.c
index 29c388a1f2..04d27309e1 100644
--- a/src/util/virperf.c
+++ b/src/util/virperf.c
@@ -17,7 +17,9 @@
*/
#include <config.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#if defined HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
#endif
diff --git a/src/util/virvsock.c b/src/util/virvsock.c
index b28287fdee..2638c5095a 100644
--- a/src/util/virvsock.c
+++ b/src/util/virvsock.c
@@ -17,7 +17,9 @@
#include <config.h>
-#include <sys/ioctl.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID
# include <linux/vhost.h>
--
2.24.1