aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 89b64bcad3..a403fa81d6 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -232,9 +232,13 @@ module Logging
@postpone = 0
@quiet = $extmk
- def self::open
- @log ||= File::open(@logfile, 'w')
+ def self::log_open
+ @log ||= File::open(@logfile, 'wb')
@log.sync = true
+ end
+
+ def self::open
+ log_open
$stderr.reopen(@log)
$stdout.reopen(@log)
yield
@@ -244,8 +248,7 @@ module Logging
end
def self::message(*s)
- @log ||= File::open(@logfile, 'w')
- @log.sync = true
+ log_open
@log.printf(*s)
end