Skip to content

Commit 2a4b472

Browse files
devnexenpm215
authored andcommitted
osdep.h: Always include <sys/signal.h> if it exists
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 <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Peter Maydell <[email protected]> Message-id: [email protected] [PMM: Expanded commit message; rename to HAVE_SYS_SIGNAL_H] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
1 parent 195588c commit 2a4b472

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

configure

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,13 @@ if check_include "libdrm/drm.h" ; then
32443244
have_drm_h=yes
32453245
fi
32463246

3247+
#########################################
3248+
# sys/signal.h check
3249+
have_sys_signal_h=no
3250+
if check_include "sys/signal.h" ; then
3251+
have_sys_signal_h=yes
3252+
fi
3253+
32473254
##########################################
32483255
# VTE probe
32493256

@@ -7433,6 +7440,9 @@ fi
74337440
if test "$have_openpty" = "yes" ; then
74347441
echo "HAVE_OPENPTY=y" >> $config_host_mak
74357442
fi
7443+
if test "$have_sys_signal_h" = "yes" ; then
7444+
echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
7445+
fi
74367446

74377447
# Work around a system header bug with some kernel/XFS header
74387448
# versions where they both try to define 'struct fsxattr':

hw/xen/xen-legacy-backend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424

2525
#include "qemu/osdep.h"
26-
#include <sys/signal.h>
2726

2827
#include "hw/sysbus.h"
2928
#include "hw/boards.h"

include/qemu/osdep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ extern int daemon(int, int);
104104
#include <setjmp.h>
105105
#include <signal.h>
106106

107-
#ifdef __OpenBSD__
107+
#ifdef HAVE_SYS_SIGNAL_H
108108
#include <sys/signal.h>
109109
#endif
110110

util/oslib-posix.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "qemu/sockets.h"
3939
#include "qemu/thread.h"
4040
#include <libgen.h>
41-
#include <sys/signal.h>
4241
#include "qemu/cutils.h"
4342

4443
#ifdef CONFIG_LINUX

0 commit comments

Comments
 (0)