diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-21 23:32:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-21 23:32:33 -0400 |
commit | ed79596b758935a3f22bf6803bc082a6bbe10f58 (patch) | |
tree | 885a8a50e68dafb39ec886cb31aa4c549fbeb35e /Remote | |
parent | bee420bd2d0cbe16489b061b208083e2b8ba9d0e (diff) |
noop
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/Directory.hs | 3 | ||||
-rw-r--r-- | Remote/Helper/Hooks.hs | 4 | ||||
-rw-r--r-- | Remote/S3.hs | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs index fd5a6f0b1..7521e7013 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -195,7 +195,8 @@ meteredWriteFile' meterupdate dest startstate feeder = where feed state [] h = do (state', cs) <- feeder state - if null cs then return () else feed state' cs h + unless (null cs) $ + feed state' cs h feed state (c:cs) h = do S.hPut h c meterupdate $ toInteger $ S.length c diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs index 40484b2a7..d85959062 100644 --- a/Remote/Helper/Hooks.hs +++ b/Remote/Helper/Hooks.hs @@ -46,7 +46,7 @@ runHooks r starthook stophook a = do a where remoteid = show (uuid r) - run Nothing = return () + run Nothing = noop run (Just command) = void $ liftIO $ boolSystem "sh" [Param "-c", Param command] firstrun lck = do @@ -81,7 +81,7 @@ runHooks r starthook stophook a = do v <- liftIO $ tryIO $ setLock fd (WriteLock, AbsoluteSeek, 0, 0) case v of - Left _ -> return () + Left _ -> noop Right _ -> run stophook liftIO $ closeFd fd diff --git a/Remote/S3.hs b/Remote/S3.hs index a688ffcf3..18d4915dc 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -93,7 +93,7 @@ s3Setup u c = handlehost $ M.lookup "host" c archiveorg = do showNote "Internet Archive mode" - maybe (error "specify bucket=") (const $ return ()) $ + maybe (error "specify bucket=") (const noop) $ M.lookup "bucket" archiveconfig use archiveconfig where @@ -237,13 +237,13 @@ genBucket c = do showAction "checking bucket" loc <- liftIO $ getBucketLocation conn bucket case loc of - Right _ -> return () + Right _ -> noop Left err@(NetworkError _) -> s3Error err Left (AWSError _ _) -> do showAction $ "creating bucket in " ++ datacenter res <- liftIO $ createBucketIn conn bucket datacenter case res of - Right _ -> return () + Right _ -> noop Left err -> s3Error err where bucket = fromJust $ M.lookup "bucket" c |