Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Portable epochTime is now available in unix-compat

  • Loading branch information...
commit fa804d585de4444d40a08b2e3dea3fa1b454e0f6 1 parent 446969d
@jystic jystic authored
View
2  snap-server.cabal
@@ -128,7 +128,7 @@ Library
time,
transformers,
utf8-string,
- unix-compat,
+ unix-compat == 0.2.*,
vector >= 0.6 && <0.7
if flag(portable) || os(windows)
View
16 src/Snap/Internal/Http/Server/Date.hs
@@ -14,12 +14,7 @@ import Data.IORef
import Data.Maybe
import Foreign.C.Types
import System.IO.Unsafe
-
-#ifndef PORTABLE
-import System.Posix.Time
-#else
-import Data.Time.Clock.POSIX
-#endif
+import System.PosixCompat.Time
import Snap.Internal.Http.Types (formatHttpTime, formatLogTime)
@@ -62,15 +57,6 @@ dateState = unsafePerformIO $ do
return d
-#ifdef PORTABLE
-------------------------------------------------------------------------------
-epochTime :: IO CTime
-epochTime = do
- t <- getPOSIXTime
- return $ fromInteger $ truncate t
-#endif
-
-
------------------------------------------------------------------------------
fetchTime :: IO (ByteString,ByteString,CTime)
fetchTime = do
View
2  test/snap-server-testsuite.cabal
@@ -103,7 +103,7 @@ Executable pongserver
template-haskell,
time,
transformers,
- unix-compat,
+ unix-compat == 0.2.*,
utf8-string >= 0.3.6 && <0.4,
vector >= 0.6.0.1 && < 0.7
Please sign in to comment.
Something went wrong with that request. Please try again.