summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-20 14:00:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-20 14:00:15 +0000
commite95d69038046f7929721905e95fb454a853b09e3 (patch)
tree9fe6f2d70c5e3d3e8d828078af103d3b08948f0c /ext/extmk.rb
parent2dc01a5f2f0a0968cf142bf3de06bd0240476722 (diff)
ext/extmk.rb: reopen stdout
* ext/extmk.rb (extmake): reopen $stdout to NULL, since setting $stdout cannot affect child processes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index e37ea66..9293eca 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -187,15 +187,18 @@ def extmake(target)
Logging::logfile 'mkmf.log'
rm_f makefile
if conf
+ stdout = $stdout.dup
+ stderr = $stderr.dup
unless verbose?
- stdout, $stdout = $stdout, File.open(File::NULL, "a")
- else
- stdout = $stdout
+ $stderr.reopen($stdout.reopen(File::NULL))
end
begin
load $0 = conf
ensure
- $stdout = stdout
+ $stderr.reopen(stderr)
+ $stdout.reopen(stdout)
+ stdout.close
+ stderr.close
end
else
create_makefile(target)