summaryrefslogtreecommitdiff
path: root/Logs/Transfer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs/Transfer.hs')
-rw-r--r--Logs/Transfer.hs20
1 files changed, 5 insertions, 15 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index e998a56b1..ebbb153ac 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -17,6 +17,10 @@ import Types.Key
import Utility.Metered
import Utility.Percentage
import Utility.QuickCheck
+import Utility.PID
+#ifdef mingw32_HOST_OS
+import Utility.WinLock
+#endif
import Data.Time.Clock
import Data.Time.Clock.POSIX
@@ -24,20 +28,6 @@ import Data.Time
import System.Locale
import Control.Concurrent
-#ifndef mingw32_HOST_OS
-import System.Posix.Types (ProcessID)
-#else
-import System.Win32.Process (ProcessId)
-import System.Win32.Process.Current (getCurrentProcessId)
-import Utility.WinLock
-#endif
-
-#ifndef mingw32_HOST_OS
-type PID = ProcessID
-#else
-type PID = ProcessId
-#endif
-
{- Enough information to uniquely identify a transfer, used as the filename
- of the transfer information file. -}
data Transfer = Transfer
@@ -231,7 +221,7 @@ startTransferInfo file = TransferInfo
#ifndef mingw32_HOST_OS
<*> pure Nothing -- pid not stored in file, so omitted for speed
#else
- <*> (Just <$> getCurrentProcessId)
+ <*> (Just <$> getPID)
#endif
<*> pure Nothing -- tid ditto
<*> pure Nothing -- not 0; transfer may be resuming