From d53f70e2039a00b2ba2b87e26f29705d8f4c629a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Jul 2012 17:26:53 -0400 Subject: 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. --- Logs/Transfer.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Logs') 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) -- cgit v1.2.3