aboutsummaryrefslogtreecommitdiff
path: root/Utility/LogFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
commitd0fa82fb721cdc85438287e29a94cb796b7bc464 (patch)
tree26a2486b8e715b5937ce41679eafd42c02f2310a /Utility/LogFile.hs
parent679eaf6077375c5d59501d12c79e0891cbdd904f (diff)
git-annex now builds on Windows (doesn't work)
Diffstat (limited to 'Utility/LogFile.hs')
-rwxr-xr-xUtility/LogFile.hs17
1 files changed, 14 insertions, 3 deletions
diff --git a/Utility/LogFile.hs b/Utility/LogFile.hs
index c6faee028..ccda429fc 100755
--- a/Utility/LogFile.hs
+++ b/Utility/LogFile.hs
@@ -11,15 +11,18 @@ module Utility.LogFile where
import Common
-#ifndef mingw32_HOST_OS
-import System.Posix
-#endif
+import System.Posix.Types
+import System.PosixCompat.Files
openLog :: FilePath -> IO Fd
+#ifndef __WINDOWS__
openLog logfile = do
rotateLog logfile
openFd logfile WriteOnly (Just stdFileMode)
defaultFileFlags { append = True }
+#else
+openLog = error "openLog TODO"
+#endif
rotateLog :: FilePath -> IO ()
rotateLog logfile = go 0
@@ -48,11 +51,19 @@ maxLogs :: Int
maxLogs = 9
redirLog :: Fd -> IO ()
+#ifndef __WINDOWS__
redirLog logfd = do
mapM_ (redir logfd) [stdOutput, stdError]
closeFd logfd
+#else
+redirLog _ = error "redirLog TODO"
+#endif
+#ifndef __WINDOWS__
redir :: Fd -> Fd -> IO ()
redir newh h = do
closeFd h
void $ dupTo newh h
+#else
+redir _ _ = error "redir TODO"
+#endif