]> gitweb @ CieloNegro.org - Lucu.git/commitdiff
Fixed two bugs
authorpho <pho@cielonegro.org>
Tue, 6 Nov 2007 03:25:33 +0000 (12:25 +0900)
committerpho <pho@cielonegro.org>
Tue, 6 Nov 2007 03:25:33 +0000 (12:25 +0900)
darcs-hash:20071106032533-62b54-ce2337eafd0204c00af6faac505f1e1bb31f2d42.gz

ImplantFile.hs
Lucu.cabal
Network/HTTP/Lucu/StaticFile.hs

index 26be80e73e7dcd109160dcfe68be812ff4c66af2..22fafeaa5acd35d413c827701265aead3a0d2349 100644 (file)
@@ -393,7 +393,7 @@ getMIMEType opts srcFile
 getLastModified :: FilePath -> IO UTCTime
 getLastModified "-"   = getCurrentTime
 getLastModified fpath = getFileStatus fpath
-                        >>= return . posixSecondsToUTCTime . toEnum . fromEnum . modificationTime
+                        >>= return . posixSecondsToUTCTime . fromRational . toRational . modificationTime
 
 
 getETag :: [CmdOpt] -> Lazy.ByteString -> IO String
index d527a40ba6acffff8d25120cc749b34728ffe1f1..e545e99ade1f3e0b7d4220270c41b9f62c19bed0 100644 (file)
@@ -24,6 +24,10 @@ Extra-Source-Files:
     examples/HelloWorld.hs
     examples/Makefile
 
+Flag build-lucu-implant-file
+    Description: Build the lucu-implant-file program.
+    Default:     True
+
 Library
     Build-Depends:
         Crypto, base, bytestring, containers, directory, haskell-src,
@@ -66,9 +70,14 @@ Library
         -funbox-strict-fields
 
 Executable lucu-implant-file
+    if flag(build-lucu-implant-file)
+        Buildable: True
+    else
+        Buildable: False
     Main-Is: ImplantFile.hs
     ghc-options:
         -Wall
+        -XUnboxedTuples
         -funbox-strict-fields
 
 --Executable HelloWorld
index 7c2ce5c4d455602c133cdfcc4669f937532f6674..608d608169dfa0bdcffbf24a1e600ef6baa8a1c3 100644 (file)
@@ -64,7 +64,7 @@ handleStaticFile path
                            $ abort Forbidden [] Nothing
                        -- 讀める
                        tag     <- liftIO $ generateETagFromFile path
-                       lastMod <- return $ posixSecondsToUTCTime $ toEnum $ fromEnum $ modificationTime stat
+                       lastMod <- return $ posixSecondsToUTCTime $ fromRational $ toRational $ modificationTime stat
                        foundEntity tag lastMod
 
                        -- MIME Type を推定