diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-29 16:46:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-29 16:54:51 -0400 |
commit | 63a2756c8685418ec3743dca1cd7a5f0237f0762 (patch) | |
tree | 9f5206fcd943ebc1cd4d4f0da666c5e7a98ca9ae /Assistant/Threads/Committer.hs | |
parent | f2214ee8978ee123a9833ab81d2e78a7d1867f71 (diff) |
remove hard link when sanity check failed
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r-- | Assistant/Threads/Committer.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 445e44dea..ca2148236 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -213,7 +213,10 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do ks <- liftIO $ getSymbolicLinkStatus $ contentLocation keysource if deviceID ks == deviceID fs && fileID ks == fileID fs then a - else return Nothing + else do + -- remove the hard link + void $ liftIO $ tryIO $ removeFile $ contentLocation keysource + return Nothing {- Files can Either be Right to be added now, - or are unsafe, and must be Left for later. |