diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-08-03 15:54:29 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-08-03 15:54:29 -0400 |
commit | 657fad53789cbd37076b819eae0b9f91fd92efac (patch) | |
tree | c9a69afbb94354d73df402542796b6d0e1a96871 | |
parent | 3888a4fbdd13647bb26fe0a4217676792cb4fc81 (diff) |
windows build warning fixes
-rw-r--r-- | Annex/Content.hs | 5 | ||||
-rw-r--r-- | Utility/Directory.hs | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 1a2ed06c1..077407071 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -176,8 +176,6 @@ lockContent key a = do (const $ a $ ContentLock key ) where alreadylocked = error "content is locked" - failedtolock e = error $ "failed to lock content: " ++ show e - trylock locker = locker `catchIO` failedtolock cleanuplockfile lockfile = modifyContent lockfile $ void $ liftIO $ tryIO $ nukeFile lockfile @@ -197,6 +195,9 @@ lockContent key a = do unlock mlockfile lck = do maybe noop cleanuplockfile mlockfile liftIO $ dropLock lck + + failedtolock e = error $ "failed to lock content: " ++ show e + trylock locker = locker `catchIO` failedtolock #else lock _ (Just lockfile) = do modifyContent lockfile $ diff --git a/Utility/Directory.hs b/Utility/Directory.hs index 2d9e9c40e..fae33b5c2 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -13,7 +13,6 @@ module Utility.Directory where import System.IO.Error import System.Directory import Control.Monad -import Control.Monad.IfElse import System.FilePath import Control.Applicative import Control.Concurrent @@ -25,10 +24,11 @@ import Prelude import qualified System.Win32 as Win32 #else import qualified System.Posix as Posix +import Utility.SafeCommand +import Control.Monad.IfElse #endif import Utility.PosixFiles -import Utility.SafeCommand import Utility.Tmp import Utility.Exception import Utility.Monad @@ -126,7 +126,7 @@ moveFile src dest = tryIO (rename src dest) >>= onrename #else r <- tryIO $ copyFile src tmp let (ok, e') = case r of - Left e' -> (False, e') + Left err -> (False, err) Right _ -> (True, e) #endif unless ok $ do |