diff options
author | Ian Lynagh <igloo@earth.li> | 2012-02-24 22:49:14 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-02-24 22:49:14 +0000 |
commit | 4c5464f903534fd70d68c5370bf8b6ff528d3fd0 (patch) | |
tree | 4a7b35b9f239487c8e9b8455a2a3886ae99c8c09 /compiler/main/SysTools.lhs | |
parent | 778ca5de01f1f6622101317eed0d5befcfba0c46 (diff) | |
download | haskell-4c5464f903534fd70d68c5370bf8b6ff528d3fd0.tar.gz |
Abstract out the hFlush calls in the GHC API
stdout/stderr might be closed, so we can't just hFlush them.
So we instead allow configuration in the same way that log_action
is configurable.
Diffstat (limited to 'compiler/main/SysTools.lhs')
-rw-r--r-- | compiler/main/SysTools.lhs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index b46ca17f49..5d643f1319 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -922,7 +922,8 @@ traceCmd dflags phase_name cmd_line action = do { let verb = verbosity dflags ; showPass dflags phase_name ; debugTraceMsg dflags 3 (text cmd_line) - ; hFlush stderr + ; case flushErr dflags of + FlushErr io -> io -- And run it! ; action `catchIO` handle_exn verb |