]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
osdep.h: Always include <sys/signal.h> if it exists
authorDavid CARLIER <devnexen@gmail.com>
Mon, 13 Jul 2020 13:36:09 +0000 (14:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Jul 2020 13:36:09 +0000 (14:36 +0100)
Regularize our handling of <sys/signal.h>: currently we include it in
osdep.h, but only for OpenBSD, and we include it without an ifdef
guard in a couple of C files.  This causes problems for Haiku, which
doesn't have that header.

Instead, check in configure whether sys/signal.h exists, and if it
does then always include it from osdep.h.

Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20200703145614.16684-5-peter.maydell@linaro.org
[PMM: Expanded commit message; rename to HAVE_SYS_SIGNAL_H]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
configure
hw/xen/xen-legacy-backend.c
include/qemu/osdep.h
util/oslib-posix.c

index 429c938708e521dae723920bb8fd33e1c3558658..bc3b9ad9317a441b8d507b157bfa7b532b4a4c3e 100755 (executable)
--- a/configure
+++ b/configure
@@ -3244,6 +3244,13 @@ if check_include "libdrm/drm.h" ; then
     have_drm_h=yes
 fi
 
+#########################################
+# sys/signal.h check
+have_sys_signal_h=no
+if check_include "sys/signal.h" ; then
+  have_sys_signal_h=yes
+fi
+
 ##########################################
 # VTE probe
 
@@ -7433,6 +7440,9 @@ fi
 if test "$have_openpty" = "yes" ; then
     echo "HAVE_OPENPTY=y" >> $config_host_mak
 fi
+if test "$have_sys_signal_h" = "yes" ; then
+    echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
index 083d8dc1b28b0677e4280a80b0a4342aa93f1cee..b61a4855b7b80c29000b96ed54b03e3813a0e05b 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/signal.h>
 
 #include "hw/sysbus.h"
 #include "hw/boards.h"
index 0fc206ae61542ca314673b9e41ed4a84ef3afa61..14059bce5a708fc277f23cdb301f3059f025f79c 100644 (file)
@@ -104,7 +104,7 @@ extern int daemon(int, int);
 #include <setjmp.h>
 #include <signal.h>
 
-#ifdef __OpenBSD__
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
 #endif
 
index 39ddc77c85bf4490623180052ffe5c40b3de621e..7ad9195c445f881ccdc952caec6944c2cbd7e43e 100644 (file)
@@ -38,7 +38,6 @@
 #include "qemu/sockets.h"
 #include "qemu/thread.h"
 #include <libgen.h>
-#include <sys/signal.h>
 #include "qemu/cutils.h"
 
 #ifdef CONFIG_LINUX