avoid head

This commit is contained in:
Joey Hess 2012-08-05 15:08:58 -04:00
parent 0833eb43a6
commit ac71ab7bd7
2 changed files with 7 additions and 5 deletions

View file

@ -98,11 +98,11 @@ checkMountMonitor :: Client -> IO Bool
checkMountMonitor client = do
running <- filter (`elem` usableservices)
<$> listServiceNames client
if null running
then startOneService client startableservices
else do
case running of
[] -> startOneService client startableservices
(service:_) -> do
debug thisThread [ "Using running DBUS service"
, Prelude.head running
, service
, "to monitor mount events."
]
return True