diff options
author | Jose A Ortega Ruiz <jao@gnu.org> | 2010-02-14 18:56:47 +0100 |
---|---|---|
committer | Jose A Ortega Ruiz <jao@gnu.org> | 2010-02-14 18:56:47 +0100 |
commit | 47a5cdddfb46734e5d3449863c9f124dce2f7fbd (patch) | |
tree | 513603d121796c2ed25e88e34f8df95c56933511 /Plugins/Monitors | |
parent | 75e97337a0f68caacbfa7ddadcf040c6f3f889df (diff) | |
download | xmobar-47a5cdddfb46734e5d3449863c9f124dce2f7fbd.tar.gz xmobar-47a5cdddfb46734e5d3449863c9f124dce2f7fbd.tar.bz2 |
Protect against IO failres in MBox
Ignore-this: cd42eea2c51ae7fa959319be6463da14
darcs-hash:20100214175647-748be-5b24058b89f149b5d4a454eea8ff5933469f9482.gz
Diffstat (limited to 'Plugins/Monitors')
-rw-r--r-- | Plugins/Monitors/Common.hs | 1 | ||||
-rw-r--r-- | Plugins/Monitors/Top.hs | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 2d35a71..c99a40f 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -53,7 +53,6 @@ module Plugins.Monitors.Common ( import Control.Concurrent import Control.Monad.Reader -import Control.Monad (zipWithM) import qualified Data.ByteString.Lazy.Char8 as B import Data.IORef import qualified Data.Map as Map diff --git a/Plugins/Monitors/Top.hs b/Plugins/Monitors/Top.hs index 78ceee9..7e9f072 100644 --- a/Plugins/Monitors/Top.hs +++ b/Plugins/Monitors/Top.hs @@ -102,8 +102,8 @@ type Meminfo = (String, Int) meminfo :: [String] -> Meminfo meminfo fs = (n, r) - where n = processName fs - r = pageSize * (read (fs!!23)) + where !n = processName fs + !r = pageSize * (read (fs!!23)) meminfos :: IO [Meminfo] meminfos = handleProcesses ("", 0) meminfo @@ -132,9 +132,9 @@ type TimesRef = IORef Times timeEntry :: [String] -> TimeEntry timeEntry fs = (p, (n, t)) - where p = read (head fs) - n = processName fs - t = read (fs!!13) + read (fs!!14) + where !p = read (head fs) + !n = processName fs + !t = read (fs!!13) + read (fs!!14) timeEntries :: IO [TimeEntry] timeEntries = handleProcesses (0, ("", 0)) timeEntry |