summaryrefslogtreecommitdiff
path: root/Assistant/TransferrerPool.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-12 14:54:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-12 17:22:34 -0400
commitd03bfb7355d11e271664d4dea51449f8f5059780 (patch)
tree638b735821c6074f31e8556f71d7f6b1f04eb1dd /Assistant/TransferrerPool.hs
parentf869020577d759313494828d1973adcf2916b392 (diff)
build assistant and watcher on windows (doesn't work yet)
Diffstat (limited to 'Assistant/TransferrerPool.hs')
-rw-r--r--Assistant/TransferrerPool.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Assistant/TransferrerPool.hs b/Assistant/TransferrerPool.hs
index d9104f74d..bb4648731 100644
--- a/Assistant/TransferrerPool.hs
+++ b/Assistant/TransferrerPool.hs
@@ -5,12 +5,17 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Assistant.TransferrerPool where
import Assistant.Common
import Assistant.Types.TransferrerPool
import Logs.Transfer
+
+#ifndef mingw32_HOST_OS
import qualified Command.TransferKeys as T
+#endif
import Control.Concurrent.STM
import System.Process (create_group)
@@ -38,13 +43,18 @@ withTransferrer program pool a = do
- finish. -}
performTransfer :: Transferrer -> Transfer -> AssociatedFile -> IO Bool
performTransfer transferrer t f = catchBoolIO $ do
+#ifndef mingw32_HOST_OS
T.sendRequest t f (transferrerWrite transferrer)
T.readResponse (transferrerRead transferrer)
+#else
+ error "TODO performTransfer not implemented on Windows"
+#endif
{- Starts a new git-annex transferkeys process, setting up a pipe
- that will be used to communicate with it. -}
mkTransferrer :: FilePath -> IO Transferrer
mkTransferrer program = do
+#ifndef mingw32_HOST_OS
(myread, twrite) <- createPipe
(tread, mywrite) <- createPipe
mapM_ (\fd -> setFdOption fd CloseOnExec True) [myread, mywrite]
@@ -68,6 +78,9 @@ mkTransferrer program = do
, transferrerWrite = mywriteh
, transferrerHandle = pid
}
+#else
+ error "TODO mkTransferrer not implemented on Windows"
+#endif
{- Checks if a Transferrer is still running. If not, makes a new one. -}
checkTransferrer :: FilePath -> Transferrer -> IO Transferrer