Revision 1251817b htools/Ganeti/Daemon.hs
b/htools/Ganeti/Daemon.hs | ||
---|---|---|
48 | 48 |
import Data.Word |
49 | 49 |
import GHC.IO.Handle (hDuplicateTo) |
50 | 50 |
import qualified Network.Socket as Socket |
51 |
import Prelude hiding (catch) |
|
52 | 51 |
import System.Console.GetOpt |
53 | 52 |
import System.Exit |
54 | 53 |
import System.Environment |
... | ... | |
218 | 217 |
-- 'Bad' value. |
219 | 218 |
writePidFile :: FilePath -> IO (Result Fd) |
220 | 219 |
writePidFile path = do |
221 |
catch (fmap Ok $ _writePidFile path) |
|
220 |
Control.Exception.catch |
|
221 |
(fmap Ok $ _writePidFile path) |
|
222 | 222 |
(return . Bad . formatIOError "Failure during writing of the pid file") |
223 | 223 |
|
224 | 224 |
-- | Sets up a daemon's environment. |
... | ... | |
282 | 282 |
def_family <- Ssconf.getPrimaryIPFamily Nothing |
283 | 283 |
ainfo <- case optBindAddress opts of |
284 | 284 |
Nothing -> return (def_family >>= defaultBindAddr port) |
285 |
Just saddr -> catch (resolveAddr port saddr) |
|
286 |
(annotateIOError $ "Invalid address " ++ saddr) |
|
285 |
Just saddr -> Control.Exception.catch |
|
286 |
(resolveAddr port saddr) |
|
287 |
(annotateIOError $ "Invalid address " ++ saddr) |
|
287 | 288 |
return ainfo |
288 | 289 |
|
289 | 290 |
-- | Run an I/O action as a daemon. |
Also available in: Unified diff