diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Inotify.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Utility/Inotify.hs b/Utility/Inotify.hs index ad0c21b22..5ed016c44 100644 --- a/Utility/Inotify.hs +++ b/Utility/Inotify.hs @@ -64,6 +64,8 @@ watchDir :: INotify -> FilePath -> (FilePath -> Bool) -> WatchHooks -> IO () watchDir i dir ignored hooks | ignored dir = noop | otherwise = do + -- Use a lock to make sure events generated during initial + -- scan come before real inotify events. lock <- newLock let handler event = withLock lock (void $ go event) void (addWatch i watchevents dir handler) |