Skip to content
Browse files

Windows does not support Posix signals

  • Loading branch information...
1 parent 25a2fce commit 609531619d0c0a097fcdae6a127418a389439208 @anlia anlia committed Jan 20, 2009
Showing with 8 additions and 2 deletions.
  1. +5 −1 Hyena/Server.hs
  2. +3 −1 hyena.cabal
View
6 Hyena/Server.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
------------------------------------------------------------------------
-- |
@@ -36,7 +36,9 @@ import Network.Wai
import Prelude hiding (catch, log)
import System.Exit (exitFailure, ExitCode(..))
import System.IO (Handle, stderr, hPutStrLn)
+#ifndef mingw32_HOST_OS
import System.Posix.Signals (Handler(..), installHandler, sigPIPE)
+#endif
import Hyena.Config
import Hyena.Http
@@ -108,7 +110,9 @@ serve application = do
-- supplied server configuration.
serveWithConfig :: Config -> Application -> IO ()
serveWithConfig conf application = do
+#ifndef mingw32_HOST_OS
installHandler sigPIPE Ignore Nothing
+#endif
when (daemonize conf) $ do
hPutStrLn stderr "Daemonized mode not supported at the moment."
hPutStrLn stderr $ "If you need this feature please say so in " ++
View
4 hyena.cabal
@@ -22,6 +22,8 @@ library
filepath, network >= 2.1 && < 2.3,
mtl >= 1 && < 1.2,
network-bytestring >= 0.1.1.2 && < 0.2,
- unix, extensible-exceptions
+ extensible-exceptions
+ if !os(windows)
+ build-depends: unix
extensions: Rank2Types
ghc-options: -funbox-strict-fields -Wall

0 comments on commit 6095316

Please sign in to comment.
Something went wrong with that request. Please try again.