summaryrefslogtreecommitdiff
path: root/Annex/Ssh.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r--Annex/Ssh.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index c3f46b4c1..e3d2c3d8b 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -101,9 +101,8 @@ sshCachingInfo :: (SshHost, Maybe Integer) -> Annex (Maybe FilePath, [CommandPar
sshCachingInfo (host, port) = go =<< sshCacheDir
where
go Nothing = return (Nothing, [])
- go (Just dir) = do
- r <- liftIO $ bestSocketPath $ dir </> hostport2socket host port
- return $ case r of
+ go (Just dir) =
+ liftIO (bestSocketPath $ dir </> hostport2socket host port) >>= return . \case
Nothing -> (Nothing, [])
Just socketfile -> (Just socketfile, sshConnectionCachingParams socketfile)
@@ -190,8 +189,7 @@ prepSocket socketfile gc sshhost sshparams = do
liftIO $ createDirectoryIfMissing True $ parentDir socketfile
let socketlock = socket2lock socketfile
- c <- Annex.getState Annex.concurrency
- case c of
+ Annex.getState Annex.concurrency >>= \case
Concurrent {}
| annexUUID (remoteGitConfig gc) /= NoUUID ->
makeconnection socketlock
@@ -267,8 +265,7 @@ sshCleanup = mapM_ cleanup =<< enumSocketFiles
let lockfile = socket2lock socketfile
unlockFile lockfile
mode <- annexFileMode
- v <- noUmask mode $ tryLockExclusive (Just mode) lockfile
- case v of
+ noUmask mode (tryLockExclusive (Just mode) lockfile) >>= \case
Nothing -> noop
Just lck -> do
forceStopSsh socketfile