diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-11 15:29:56 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-11 15:39:51 -0400 |
commit | 3c12e914c799df12a297b6eeff3e60f7ab2bf39a (patch) | |
tree | e2cc2dacf1c51bd80103833b3e2efc6868c8a2e9 /Remote | |
parent | 0653cfa5a8454d90cfda396ac64fe2f237f6b5c9 (diff) |
cleanup thanks to Utility.PID
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/Rsync.hs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs index b543387c3..570725bcf 100644 --- a/Remote/Rsync.hs +++ b/Remote/Rsync.hs @@ -18,14 +18,6 @@ module Remote.Rsync ( RsyncOpts ) where -import qualified Data.ByteString.Lazy as L -import qualified Data.Map as M -#ifndef mingw32_HOST_OS -import System.Posix.Process (getProcessID) -#else -import System.Win32.Process.Current (getCurrentProcessId) -#endif - import Common.Annex import Types.Remote import qualified Git @@ -40,10 +32,14 @@ import Crypto import Utility.Rsync import Utility.CopyFile import Utility.Metered +import Utility.PID import Annex.Perms import Logs.Transfer import Types.Creds +import qualified Data.ByteString.Lazy as L +import qualified Data.Map as M + type RsyncUrl = String data RsyncOpts = RsyncOpts @@ -250,14 +246,10 @@ sendParams = ifM crippledFileSystem - up trees for rsync. -} withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a withRsyncScratchDir a = do -#ifndef mingw32_HOST_OS - v <- liftIO getProcessID -#else - v <- liftIO getCurrentProcessId -#endif + p <- liftIO getPID t <- fromRepo gitAnnexTmpDir createAnnexDirectory t - let tmp = t </> "rsynctmp" </> show v + let tmp = t </> "rsynctmp" </> show p nuke tmp liftIO $ createDirectoryIfMissing True tmp nuke tmp `after` a tmp |