From 9f0212528bba3fd57088a0a99ec17856681a2c90 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 21 Jun 2015 17:28:52 +0200 Subject: build fixes --- src/Trivmix.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Trivmix.hs') diff --git a/src/Trivmix.hs b/src/Trivmix.hs index 79b3804..96e578b 100644 --- a/src/Trivmix.hs +++ b/src/Trivmix.hs @@ -165,7 +165,7 @@ handleFiles :: INotify -> MVar Level -> [FilePath] -> IO () handleFiles inotify level files = do initLevel <- readMVar level levelChanges <- (newChan :: IO (Chan Level)) - stderrLock <- newMVar + stderrLock <- newMVar) () let handleFile file = do levelChanges' <- dupChan levelChanges @@ -220,7 +220,7 @@ readLevel :: Chan Level -> MVar Level -> FilePath -> MVar () -> IO () readLevel levelChan current file stderrLock = catch action handler where action = do - level <- withFileLock file Shared $ readFile file >>= readIO . stripSpace + level <- withFileLock file Shared $ const $ readFile file >>= readIO . stripSpace oldLevel <- readMVar current when (oldLevel /= level) $ do writeChan levelChan level @@ -239,7 +239,7 @@ readLevel levelChan current file stderrLock = catch action handler else l writeLevel :: FilePath -> MVar () -> Level -> IO () -writeLevel file stderrLock level = withFileLock file Exclusive $ do +writeLevel file stderrLock level = withFileLock file Exclusive $ const $ do withMVarLock stderrLock $ hPutStrLn stderr $ "Writing out level ‘" ++ (show level) ++ "’ to ‘" ++ file ++ "’" writeFile file (show level ++ "\n") -- cgit v1.2.3