From 3c4ced48d5d82bc3042fdd058e684e87e7036166 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 19 Dec 2014 14:47:43 +1100 Subject: Fix SIGINFO and SIGWINCH. It seems these two signals have not been working since at least 2009. Detection of these signals seems to have never been added to the configure.ac script and the code guarded by #ifdef then bit-rotted (the idiom used to handle these signals seems to have been abandoned for something simpler/better in 2009). This fix simply handles these signals the same way the other signals are handled in System/Posix/Signals.hsc. Closes #30 and #31 --- System/Posix/Signals/Exts.hsc | 51 +++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) (limited to 'System') diff --git a/System/Posix/Signals/Exts.hsc b/System/Posix/Signals/Exts.hsc index a889340..95796a2 100644 --- a/System/Posix/Signals/Exts.hsc +++ b/System/Posix/Signals/Exts.hsc @@ -1,17 +1,14 @@ +{-# LANGUAGE CPP #-} #ifdef __GLASGOW_HASKELL__ -#if defined(SIGINFO) || defined(SIGWINCH) -{-# LANGUAGE Trustworthy #-} -#else {-# LANGUAGE Safe #-} #endif -#endif ----------------------------------------------------------------------------- -- | -- Module : System.Posix.Signals.Exts -- Copyright : (c) The University of Glasgow 2002 -- License : BSD-style (see the file libraries/base/LICENSE) --- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (requires POSIX, includes Linuxisms/BSDisms) @@ -20,45 +17,33 @@ -- ----------------------------------------------------------------------------- -#include "HsUnix.h" - -module System.Posix.Signals.Exts ( - module System.Posix.Signals +#include "HsUnixConfig.h" +##include "HsUnixConfig.h" -#ifdef SIGINFO - , infoEvent, sigINFO -#endif -#ifdef SIGWINCH - , windowChange, sigWINCH +#ifdef HAVE_SIGNAL_H +#include #endif +module System.Posix.Signals.Exts ( + module System.Posix.Signals + , sigINFO + , sigWINCH + , infoEvent + , windowChange ) where import Foreign.C import System.Posix.Signals -#ifdef __HUGS__ -# ifdef SIGINFO -sigINFO = (#const SIGINFO) :: CInt -# endif -# ifdef SIGWINCH -sigWINCH = (#const SIGWINCH) :: CInt -# endif -#else /* !HUGS */ -# ifdef SIGINFO -foreign import ccall unsafe "__hsunix_SIGINFO" sigINFO :: CInt -# endif -# ifdef SIGWINCH -foreign import ccall unsafe "__hsunix_SIGWINCH" sigWINCH :: CInt -# endif -#endif /* !HUGS */ +sigINFO :: CInt +sigINFO = CONST_SIGINFO + +sigWINCH :: CInt +sigWINCH = CONST_SIGWINCH + -#ifdef SIGINFO infoEvent :: Signal infoEvent = sigINFO -#endif -#ifdef SIGWINCH windowChange :: Signal windowChange = sigWINCH -#endif -- cgit v1.2.3