summaryrefslogtreecommitdiff
path: root/Assistant/DaemonStatus.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-30 16:32:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-30 16:32:32 -0400
commitb2e359a15d20d2b2b13a1883b451d014ae60db7c (patch)
tree32cde5030a8cd8ac22c0af7df20250280f22a760 /Assistant/DaemonStatus.hs
parent453b185c8506e4a6a030788f42eec196386ac78e (diff)
fix kqueue build
Diffstat (limited to 'Assistant/DaemonStatus.hs')
-rw-r--r--Assistant/DaemonStatus.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index 3c0bfba42..13828d3ee 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -236,9 +236,14 @@ updateAlertMap dstatus a = notifyAlert dstatus `after` modifyDaemonStatus_ dstat
- The alert is left visible afterwards, as filler.
- Old filler is pruned, to prevent the map growing too large. -}
alertWhile :: DaemonStatusHandle -> Alert -> IO Bool -> IO Bool
-alertWhile dstatus alert a = do
+alertWhile dstatus alert a = alertWhile' dstatus alert $ do
+ r <- a
+ return $ (r, r)
+
+alertWhile' :: DaemonStatusHandle -> Alert -> IO (Bool, a) -> IO a
+alertWhile' dstatus alert a = do
let alert' = alert { alertClass = Activity }
i <- addAlert dstatus alert'
- r <- bracket_ noop noop a
- updateAlertMap dstatus $ convertToFiller i r
+ (ok, r) <- bracket_ noop noop a
+ updateAlertMap dstatus $ convertToFiller i ok
return r