summaryrefslogtreecommitdiff
path: root/Utility/ThreadScheduler.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
committerJoey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
commit43b4b7d43a1c7113761d787f283118b1b4da84d6 (patch)
tree0dd60655b4c6a5684bc69b1e4f9b42764ea2b651 /Utility/ThreadScheduler.hs
parentf202d997f42233152d2ff47c7ba38c9f374e5a64 (diff)
can now build Android targeted binary
Various things that don't work on Android are just ifdefed out. * the webapp (needs template haskell for arm) * --include and --exclude globbing (needs libpcre, which is not ported; probably I'll make it use the pure haskell glob library instead) * annex.diskreserve checking (missing sys/statvfs.h) * timestamp preservation support (yawn) * S3 * WebDAV * XMPP The resulting 17mb binary has been tested on Android, and it is able to, at least, print its usage message.
Diffstat (limited to 'Utility/ThreadScheduler.hs')
-rw-r--r--Utility/ThreadScheduler.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs
index 96bccbe703..fdf40ab6d9 100644
--- a/Utility/ThreadScheduler.hs
+++ b/Utility/ThreadScheduler.hs
@@ -6,13 +6,17 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.ThreadScheduler where
import Common
import Control.Concurrent
-import System.Posix.Terminal
import System.Posix.Signals
+#ifndef WITH_ANDROID
+import System.Posix.Terminal
+#endif
newtype Seconds = Seconds { fromSeconds :: Int }
deriving (Eq, Ord, Show)
@@ -49,8 +53,10 @@ waitForTermination :: IO ()
waitForTermination = do
lock <- newEmptyMVar
check softwareTermination lock
+#ifndef WITH_ANDROID
whenM (queryTerminal stdInput) $
check keyboardSignal lock
+#endif
takeMVar lock
where
check sig lock = void $