Skip to content

Commit

Permalink
osdep.h: Always include <sys/signal.h> if it exists
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
devnexen authored and pm215 committed Jul 13, 2020
1 parent 195588c commit 2a4b472
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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':
Expand Down
1 change: 0 additions & 1 deletion hw/xen/xen-legacy-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

#include "qemu/osdep.h"
#include <sys/signal.h>

#include "hw/sysbus.h"
#include "hw/boards.h"
Expand Down
2 changes: 1 addition & 1 deletion include/qemu/osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion util/oslib-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a4b472

Please sign in to comment.