FIX file flushing errors
This commit is contained in:
parent
3cc7e02416
commit
2712ebdf37
|
@ -140,7 +140,7 @@ runXIO logfile x = withLogFile logfile $ \h -> hRunXIO True h x
|
||||||
withLogFile :: MonadUnliftIO m => FilePath -> (Handle -> m a) -> m a
|
withLogFile :: MonadUnliftIO m => FilePath -> (Handle -> m a) -> m a
|
||||||
withLogFile logfile f = do
|
withLogFile logfile f = do
|
||||||
p <- (</> logfile) . dataDir <$> liftIO getDirectories
|
p <- (</> logfile) . dataDir <$> liftIO getDirectories
|
||||||
catchIO (withFile p AppendMode f) $ \e -> do
|
catchIO (withBinaryFile p AppendMode f) $ \e -> do
|
||||||
liftIO $ print e
|
liftIO $ print e
|
||||||
liftIO $ putStrLn "could not open log file, falling back to stderr"
|
liftIO $ putStrLn "could not open log file, falling back to stderr"
|
||||||
f stderr
|
f stderr
|
||||||
|
|
|
@ -91,6 +91,8 @@ startAdapter is cs cb cl = do
|
||||||
forM_ devices $ \d -> addAndInitDevice d
|
forM_ devices $ \d -> addAndInitDevice d
|
||||||
-- after setting things up, show the icon based on the initialized state
|
-- after setting things up, show the icon based on the initialized state
|
||||||
dpy
|
dpy
|
||||||
|
-- keep file descriptors open in callback threads
|
||||||
|
forever $ threadDelay 1000000
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Icon Display
|
-- Icon Display
|
||||||
|
|
Loading…
Reference in New Issue