diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-17 17:26:53 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-17 17:26:53 -0400 |
commit | d53f70e2039a00b2ba2b87e26f29705d8f4c629a (patch) | |
tree | fd4fcd67dc6840b444123057df6ad8e73f7b4cf9 /Logs | |
parent | b702bae9501676082a1f9388286b3c9855d8a44a (diff) |
avoid parsing lock files as transfer files
This seems to happen with kqueue, not inotify. The newly added lck file
triggers an add event and was then parsed as a transfer file.
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/Transfer.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs index 55db855cc..260512067 100644 --- a/Logs/Transfer.hs +++ b/Logs/Transfer.hs @@ -144,8 +144,9 @@ transferLockFile infofile = let (d,f) = splitFileName infofile in {- Parses a transfer information filename to a Transfer. -} parseTransferFile :: FilePath -> Maybe Transfer -parseTransferFile file = - case drop (length bits - 3) bits of +parseTransferFile file + | "lck." `isPrefixOf` (takeFileName file) = Nothing + | otherwise = case drop (length bits - 3) bits of [direction, u, key] -> Transfer <$> readDirection direction <*> pure (toUUID u) |