summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index f6e4fe273..dfe1a9ab6 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -478,10 +478,9 @@ recordStartTime = do
createAnnexDirectory $ parentDir f
liftIO $ do
nukeFile f
- h <- openFile f WriteMode
- t <- modificationTime <$> getFileStatus f
- hPutStr h $ showTime $ realToFrac t
- hClose h
+ withFile f WriteMode $ \h -> do
+ t <- modificationTime <$> getFileStatus f
+ hPutStr h $ showTime $ realToFrac t
where
showTime :: POSIXTime -> String
showTime = show