summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-11 15:29:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-11 15:39:51 -0400
commit3c12e914c799df12a297b6eeff3e60f7ab2bf39a (patch)
treee2cc2dacf1c51bd80103833b3e2efc6868c8a2e9 /Command/Fsck.hs
parent0653cfa5a8454d90cfda396ac64fe2f237f6b5c9 (diff)
cleanup thanks to Utility.PID
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index dfe1a9ab6..cdbb155c2 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -31,12 +31,8 @@ import Config
import Types.Key
import Utility.HumanTime
import Git.FilePath
+import Utility.PID
-#ifndef mingw32_HOST_OS
-import System.Posix.Process (getProcessID)
-#else
-import System.Win32.Process.Current (getCurrentProcessId)
-#endif
import Data.Time.Clock.POSIX
import Data.Time
import System.Posix.Types (EpochTime)
@@ -149,14 +145,10 @@ performRemote key file backend numcopies remote =
, checkKeyNumCopies key file numcopies
]
withtmp a = do
-#ifndef mingw32_HOST_OS
- v <- liftIO getProcessID
-#else
- v <- liftIO getCurrentProcessId
-#endif
+ pid <- liftIO getPID
t <- fromRepo gitAnnexTmpDir
createAnnexDirectory t
- let tmp = t </> "fsck" ++ show v ++ "." ++ keyFile key
+ let tmp = t </> "fsck" ++ show pid ++ "." ++ keyFile key
let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
cleanup
cleanup `after` a tmp