Commit 44f7f902 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Use toErrorBase to slightly improve code in WConfd server



.. and get rid of unnecessary variable binding.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent ef8676d0
...@@ -79,7 +79,9 @@ prepMain _ _ = do ...@@ -79,7 +79,9 @@ prepMain _ _ = do
lock_file_present <- doesFileExist lock_file lock_file_present <- doesFileExist lock_file
unless lock_file_present unless lock_file_present
$ logInfo "No saved lock status; assuming all locks free" $ logInfo "No saved lock status; assuming all locks free"
dhOpt <- runResultT $ do dh <- toErrorBase
. withErrorT (strMsg . ("Initialization of the daemon failed" ++)
. show) $ do
ents <- getEnts ents <- getEnts
(cdata, cstat) <- loadConfigFromFile conf_file (cdata, cstat) <- loadConfigFromFile conf_file
lock <- if lock_file_present lock <- if lock_file_present
...@@ -92,8 +94,6 @@ prepMain _ _ = do ...@@ -92,8 +94,6 @@ prepMain _ _ = do
(distMCsAsyncTask ents conf_file) (distMCsAsyncTask ents conf_file)
distSSConfAsyncTask distSSConfAsyncTask
(writeLocksAsyncTask lock_file) (writeLocksAsyncTask lock_file)
dh <- withError (strMsg . ("Initialization of the daemon failed" ++) . show)
dhOpt
return (s, dh) return (s, dh)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment