From d0fa82fb721cdc85438287e29a94cb796b7bc464 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 May 2013 15:03:00 -0500 Subject: git-annex now builds on Windows (doesn't work) --- Utility/LogFile.hs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Utility/LogFile.hs') 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 -- cgit v1.2.3