Skip to content
Browse files

Portable epochTime is now available in unix-compat

  • Loading branch information...
1 parent 446969d commit fa804d585de4444d40a08b2e3dea3fa1b454e0f6 @jystic jystic committed Oct 15, 2010
Showing with 3 additions and 17 deletions.
  1. +1 −1 snap-server.cabal
  2. +1 −15 src/Snap/Internal/Http/Server/Date.hs
  3. +1 −1 test/snap-server-testsuite.cabal
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

0 comments on commit fa804d5

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