diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-04-29 12:29:44 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-04-29 12:29:44 +0200 |
commit | 5baa3a864695158b4c4a83c21a4a62403ff37e75 (patch) | |
tree | 370e33251212e97a6f16c1023231be30caa030e8 /Plugins/Monitors/Weather.hs | |
parent | f41dc7b572acf85907a6cb5fdc6ecfee715621df (diff) | |
download | xmobar-5baa3a864695158b4c4a83c21a4a62403ff37e75.tar.gz xmobar-5baa3a864695158b4c4a83c21a4a62403ff37e75.tar.bz2 |
Weather: close handles when successfully retrieving the data
darcs-hash:20080429102944-d6583-434595c6b2d189fa89fd18bdf763f422754ec147.gz
Diffstat (limited to 'Plugins/Monitors/Weather.hs')
-rw-r--r-- | Plugins/Monitors/Weather.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Plugins/Monitors/Weather.hs b/Plugins/Monitors/Weather.hs index 9a60876..15d084e 100644 --- a/Plugins/Monitors/Weather.hs +++ b/Plugins/Monitors/Weather.hs @@ -16,6 +16,7 @@ module Plugins.Monitors.Weather where import Plugins.Monitors.Common +import Control.Monad (when) import System.Process import System.Exit import System.IO @@ -120,6 +121,8 @@ getData url= hClose e case exit of ExitSuccess -> do str <- hGetContents o + when (str == str) $ return () + closeHandles return str _ -> do closeHandles return "Could not retrieve data" |