From 5baa3a864695158b4c4a83c21a4a62403ff37e75 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Tue, 29 Apr 2008 12:29:44 +0200 Subject: Weather: close handles when successfully retrieving the data darcs-hash:20080429102944-d6583-434595c6b2d189fa89fd18bdf763f422754ec147.gz --- Plugins/Monitors/Weather.hs | 3 +++ 1 file changed, 3 insertions(+) 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" -- cgit v1.2.3