aboutsummaryrefslogtreecommitdiff
path: root/Annex/Content
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-13 19:29:52 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-13 19:29:52 -0500
commite6f0aac11f08ebc3a7e8e9b343b7c8b866cb2e25 (patch)
tree7c274de601e47862ed0289a260a7bebf6e5b7612 /Annex/Content
parentb02c68304aa5051086e29a0cb6547fdf856aa93d (diff)
read inode cache file strictly to avoid failure to drop on windows
Seems that Windows doesn't allow deleting a file that the same process has open. Here the inode cache file was read and a the value from it gets used later. But due to laziness, the old file is still open when it gets deleted. Adding strictness avoids this problem. Of course, the file is small, so it's no problem to read it all strictly, so this is probably an improvement even outside of Windows.
Diffstat (limited to 'Annex/Content')
-rwxr-xr-x[-rw-r--r--]Annex/Content/Direct.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 54befdf73..025ff60bf 100644..100755
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -110,7 +110,7 @@ goodContent key file = sameInodeCache file =<< recordedInodeCache key
recordedInodeCache :: Key -> Annex [InodeCache]
recordedInodeCache key = withInodeCacheFile key $ \f ->
liftIO $ catchDefaultIO [] $
- mapMaybe readInodeCache . lines <$> readFile f
+ mapMaybe readInodeCache . lines <$> readFileStrict f
{- Caches an inode for a file.
-