Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Windows does not support Posix signals

  • Loading branch information...
commit 609531619d0c0a097fcdae6a127418a389439208 1 parent 25a2fce
Felix Martini fmartini authored

Showing 2 changed files with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 1 Hyena/Server.hs
  2. +3 1 hyena.cabal
6 Hyena/Server.hs
... ... @@ -1,4 +1,4 @@
1   -{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
  1 +{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
2 2
3 3 ------------------------------------------------------------------------
4 4 -- |
@@ -36,7 +36,9 @@ import Network.Wai
36 36 import Prelude hiding (catch, log)
37 37 import System.Exit (exitFailure, ExitCode(..))
38 38 import System.IO (Handle, stderr, hPutStrLn)
  39 +#ifndef mingw32_HOST_OS
39 40 import System.Posix.Signals (Handler(..), installHandler, sigPIPE)
  41 +#endif
40 42
41 43 import Hyena.Config
42 44 import Hyena.Http
@@ -108,7 +110,9 @@ serve application = do
108 110 -- supplied server configuration.
109 111 serveWithConfig :: Config -> Application -> IO ()
110 112 serveWithConfig conf application = do
  113 +#ifndef mingw32_HOST_OS
111 114 installHandler sigPIPE Ignore Nothing
  115 +#endif
112 116 when (daemonize conf) $ do
113 117 hPutStrLn stderr "Daemonized mode not supported at the moment."
114 118 hPutStrLn stderr $ "If you need this feature please say so in " ++
4 hyena.cabal
@@ -22,6 +22,8 @@ library
22 22 filepath, network >= 2.1 && < 2.3,
23 23 mtl >= 1 && < 1.2,
24 24 network-bytestring >= 0.1.1.2 && < 0.2,
25   - unix, extensible-exceptions
  25 + extensible-exceptions
  26 + if !os(windows)
  27 + build-depends: unix
26 28 extensions: Rank2Types
27 29 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.