[commit: ghc] ghc-parmake-gsoc: Make stdout and stderr line-buffered (e8d0dc7)

git at git.haskell.org git at git.haskell.org
Tue Aug 27 16:11:30 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-parmake-gsoc
Link       : http://ghc.haskell.org/trac/ghc/changeset/e8d0dc7e00e7c55bd23bcccd059683f8a7eadfd1/ghc

>---------------------------------------------------------------

commit e8d0dc7e00e7c55bd23bcccd059683f8a7eadfd1
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Wed Aug 21 16:53:15 2013 -0400

    Make stdout and stderr line-buffered
    
    An unbuffered handle is very slow to output to and there doesn't seem to
    be any reason to have these handles unbuffered.


>---------------------------------------------------------------

e8d0dc7e00e7c55bd23bcccd059683f8a7eadfd1
 ghc/InteractiveUI.hs |    1 +
 ghc/Main.hs          |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 91648a3..80032f2 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -388,6 +388,7 @@ interactiveUI config srcs maybe_exprs = do
         -- We don't want the cmd line to buffer any input that might be
         -- intended for the program, so unbuffer stdin.
         hSetBuffering stdin NoBuffering
+        hSetBuffering stderr NoBuffering
 #if defined(mingw32_HOST_OS)
         -- On Unix, stdin will use the locale encoding.  The IO library
         -- doesn't do this on Windows (yet), so for now we use UTF-8,
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 66db90a..868042b 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -76,8 +76,8 @@ import Data.Maybe
 
 main :: IO ()
 main = do
-   hSetBuffering stdout NoBuffering
-   hSetBuffering stderr NoBuffering
+   hSetBuffering stdout LineBuffering
+   hSetBuffering stderr LineBuffering
    GHC.defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
     -- 1. extract the -B flag from the args
     argv0 <- getArgs





More information about the ghc-commits mailing list