X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRtsUtils.c;h=09154da45afed6aa9eb04906e9c622baa6b026a5;hb=0d52a0a134871d317b5f8b53a952c882ce5ae5b6;hp=f4d61b1992dda014b9b080402d8738375f9ca85b;hpb=20d697a1c300663df2c1472e222e57c84c4385fc;p=ghc-hetmet.git diff --git a/ghc/rts/RtsUtils.c b/ghc/rts/RtsUtils.c index f4d61b1..09154da 100644 --- a/ghc/rts/RtsUtils.c +++ b/ghc/rts/RtsUtils.c @@ -32,13 +32,12 @@ #include #include -#if defined(openbsd_TARGET_OS) -# ifdef HAVE_SIGNAL_H -# include -# endif -# ifdef HAVE_PTHREAD_H -# include -# endif +#ifdef HAVE_SIGNAL_H +#include +#endif + +#if defined(THREADED_RTS) && defined(openbsd_TARGET_OS) && defined(HAVE_PTHREAD_H) +#include #endif /* ----------------------------------------------------------------------------- @@ -298,18 +297,16 @@ heapCheckFail( void ) #endif /* - * It seems that pthreads and signals interact oddly in OpenBSD - * pthreads (and possibly FreeBSD). When linking with -lpthreads, we + * It seems that pthreads and signals interact oddly in OpenBSD & FreeBSD + * pthreads (and possibly others). When linking with -lpthreads, we * have to use pthread_kill to send blockable signals. So use that * when we have a threaded rts. So System.Posix.Signals will call * genericRaise(), rather than raise(3). */ -#if defined(openbsd_TARGET_OS) int genericRaise(int sig) { -# if defined(THREADED_RTS) +#if defined(THREADED_RTS) && (defined(openbsd_TARGET_OS) || defined(freebsd_TARGET_OS)) return pthread_kill(pthread_self(), sig); -# else +#else return raise(sig); -# endif -} #endif +}