diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-17 00:18:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-17 00:18:07 -0400 |
commit | e8188ea611e4c9223492203c0ec0370c3c45b225 (patch) | |
tree | 2a078993be28d1dedc38f8ab9ad193eea0ecf90e /Assistant/Pairing | |
parent | ba744c84a4f683e50bf4c9b8c388e3a611f7fb91 (diff) |
flip catchDefaultIO
Diffstat (limited to 'Assistant/Pairing')
-rw-r--r-- | Assistant/Pairing/MakeRemote.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Assistant/Pairing/MakeRemote.hs b/Assistant/Pairing/MakeRemote.hs index f3c5e0d50..fae8c5ee3 100644 --- a/Assistant/Pairing/MakeRemote.hs +++ b/Assistant/Pairing/MakeRemote.hs @@ -78,7 +78,8 @@ bestHostName :: PairMsg -> IO HostName bestHostName msg = case remoteHostName $ pairMsgData msg of Just h -> do let localname = h ++ ".local" - addrs <- catchDefaultIO (getAddrInfo Nothing (Just localname) Nothing) [] + addrs <- catchDefaultIO [] $ + getAddrInfo Nothing (Just localname) Nothing maybe fallback (const $ return localname) (headMaybe addrs) Nothing -> fallback where @@ -88,4 +89,5 @@ bestHostName msg = case remoteHostName $ pairMsgData msg of IPv4Addr addr -> SockAddrInet (PortNum 0) addr IPv6Addr addr -> SockAddrInet6 (PortNum 0) 0 addr 0 fromMaybe (showAddr a) - <$> catchDefaultIO (fst <$> getNameInfo [] True False sockaddr) Nothing + <$> catchDefaultIO Nothing + (fst <$> getNameInfo [] True False sockaddr) |