blob: d4508c9167938ea79a37108abfc791225cc2753f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
From b7345a790e8026a2075ce636ac377d8f049b4b7c Mon Sep 17 00:00:00 2001
From: Thomas Dziedzic <gostrc@gmail.com>
Date: Wed, 3 Oct 2012 06:51:21 -0700
Subject: [PATCH] Update usage of catch to catchIOError since catch has been
removed from System.IO.Error in ghc 7.6.1
---
src/Plugins/Monitors/Bright.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Plugins/Monitors/Bright.hs b/src/Plugins/Monitors/Bright.hs
index 499e5bc..b5ec4c0 100644
--- a/src/Plugins/Monitors/Bright.hs
+++ b/src/Plugins/Monitors/Bright.hs
@@ -20,6 +20,7 @@ import Data.Char
import System.FilePath ((</>))
import System.Posix.Files (fileExist)
import System.Console.GetOpt
+import System.IO.Error (catchIOError)
data BrightOpts = BrightOpts
{ subDir :: String
@@ -101,7 +102,7 @@ readBright files =
maxVal <- grab $ (fMax files)
return $ (currVal / maxVal)
where
- grab f = catch (fmap (read . B.unpack) $ B.readFile f)(\_ -> return 0)
+ grab f = catchIOError (fmap (read . B.unpack) $ B.readFile f)(\_ -> return 0)
showHorizontalBar :: Float -> Monitor String
--
1.7.12.2
|