From 8aa1db682b2a5c864fc745866534999b6db14e9b Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Fri, 1 Mar 2013 19:03:48 +0100 Subject: [PATCH] Check for sys/signal.h and/or signal.h mingw-w64 does not actually have sys/signal.h, while OSX currently has a broken signal.h Better check the presence of both and use sys/signal.h if present, else signal.h --- configure.ac | 2 ++ src/util.cc | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9d4437d7..e4c86682 100644 --- a/configure.ac +++ b/configure.ac @@ -364,6 +364,7 @@ AC_CHECK_HEADERS([argz.h \ netinet/tcp.h \ poll.h \ port.h \ + signal.h \ stddef.h \ stdint.h \ stdio_ext.h \ @@ -372,6 +373,7 @@ AC_CHECK_HEADERS([argz.h \ strings.h \ sys/ioctl.h \ sys/param.h \ + sys/signal.h \ sys/socket.h \ sys/time.h \ sys/types.h \ diff --git a/src/util.cc b/src/util.cc index 92a4db9e..73834637 100644 --- a/src/util.cc +++ b/src/util.cc @@ -34,7 +34,14 @@ /* copyright --> */ #include "util.h" -#include +#ifdef HAVE_SYS_SIGNAL_H +# include +#else // HAVE_SYS_SIGNAL_H +# ifdef HAVE_SIGNAL_H +# include +# endif // HAVE_SIGNAL_H +#endif // HAVE_SYS_SIGNAL_H + #include #ifdef HAVE_PWD_H # include