diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-07 07:40:25 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-07 07:40:25 +0000 |
| commit | 001dadd271817e150d887e0a54059ddc95d0574b (patch) | |
| tree | d9660e088187b3469678fe1a3407d3b364dab962 /bootstraptest | |
| parent | 14691b4306d71d2de3e490e3ccfab50aa2165765 (diff) | |
| download | ruby-001dadd271817e150d887e0a54059ddc95d0574b.tar.gz ruby-001dadd271817e150d887e0a54059ddc95d0574b.tar.xz ruby-001dadd271817e150d887e0a54059ddc95d0574b.zip | |
* io.c (io_reopen): don't change access mode for stdin, stdout and
stderr. [ruby-core:15360]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_io.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb index 55b7ce01c..a5d54afc5 100644 --- a/bootstraptest/test_io.rb +++ b/bootstraptest/test_io.rb @@ -36,3 +36,19 @@ assert_finish 1, %q{ } r.gets("abab") } + +assert_equal 'ok', %q{ + require 'tmpdir' + begin + tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}" + rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL) + rescue Errno::EEXIST + retry + end + save = STDIN.dup + STDIN.reopen(rw) + STDIN.reopen(save) + rw.close + File.unlink(tmpname) + :ok +} |
