diff options
-rw-r--r-- | src/Trivmix.hs | 5 | ||||
-rw-r--r-- | trivmix.cabal | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Trivmix.hs b/src/Trivmix.hs index 5dc213c..69fcea2 100644 --- a/src/Trivmix.hs +++ b/src/Trivmix.hs | |||
@@ -115,7 +115,8 @@ main = execParser opts >>= trivmix | |||
115 | trivmix :: Options -> IO () | 115 | trivmix :: Options -> IO () |
116 | trivmix Options{..} = do | 116 | trivmix Options{..} = do |
117 | level <- newMVar initialLevel | 117 | level <- newMVar initialLevel |
118 | withINotify $ \inotify -> do | 118 | let withFiles = foldl (.) id $ map (\f -> onStateFile f (show initialLevel ++ "\n")) levelFiles |
119 | withFiles $ withINotify $ \inotify -> do | ||
119 | handleFiles inotify level levelFiles | 120 | handleFiles inotify level levelFiles |
120 | Jack.handleExceptions $ | 121 | Jack.handleExceptions $ |
121 | Jack.withClientDefault client $ \client' -> | 122 | Jack.withClientDefault client $ \client' -> |
@@ -148,7 +149,7 @@ handleFiles inotify level files = do | |||
148 | forkIO $ forever $ do -- Broadcast level changes and update all files | 149 | forkIO $ forever $ do -- Broadcast level changes and update all files |
149 | readChan levelChanges' >>= writeLevel file | 150 | readChan levelChanges' >>= writeLevel file |
150 | addWatch inotify watchedAttrs file (const $ readLevel levelChanges level file) | 151 | addWatch inotify watchedAttrs file (const $ readLevel levelChanges level file) |
151 | sequence [onStateFile f (show initLevel ++ "\n") $ handleFile f | f <- files] | 152 | mapM handleFile files |
152 | forkIO $ forever $ do | 153 | forkIO $ forever $ do |
153 | readChan levelChanges >>= swapMVar level | 154 | readChan levelChanges >>= swapMVar level |
154 | return () | 155 | return () |
diff --git a/trivmix.cabal b/trivmix.cabal index bb58548..1005508 100644 --- a/trivmix.cabal +++ b/trivmix.cabal | |||
@@ -2,7 +2,7 @@ | |||
2 | -- documentation, see http://haskell.org/cabal/users-guide/ | 2 | -- documentation, see http://haskell.org/cabal/users-guide/ |
3 | 3 | ||
4 | name: trivmix | 4 | name: trivmix |
5 | version: 2.2.3 | 5 | version: 2.2.4 |
6 | -- synopsis: | 6 | -- synopsis: |
7 | -- description: | 7 | -- description: |
8 | license: PublicDomain | 8 | license: PublicDomain |