diff options
author | Joey Hess <id@joeyh.name> | 2013-05-11 15:03:00 -0500 |
---|---|---|
committer | Joey Hess <id@joeyh.name> | 2013-05-11 15:03:00 -0500 |
commit | d0fa82fb721cdc85438287e29a94cb796b7bc464 (patch) | |
tree | 26a2486b8e715b5937ce41679eafd42c02f2310a /Utility/LogFile.hs | |
parent | 679eaf6077375c5d59501d12c79e0891cbdd904f (diff) |
git-annex now builds on Windows (doesn't work)
Diffstat (limited to 'Utility/LogFile.hs')
-rwxr-xr-x | Utility/LogFile.hs | 17 |
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 |