diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-25 07:47:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-25 07:47:16 +0000 |
commit | 837471aac32c1728dd04135ec2c10f6e1c376e90 (patch) | |
tree | 2fb200c82da68d468cc62aa1c9b35a4a32ba4e4e /test/ruby/test_io.rb | |
parent | b3a27846bdeb72b85448269b6cb1350aae570e3f (diff) | |
download | ruby-837471aac32c1728dd04135ec2c10f6e1c376e90.tar.gz |
fix conditions to setrlimit
* test/ruby/test_io.rb (test_dup_many): limit FD only if possible.
* test/ruby/test_process.rb (assert_fail_too_long_path): fix the
condition for platform specific feature
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index eac4e59a8f..5d554d7fb4 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1137,8 +1137,10 @@ class TestIO < Test::Unit::TestCase def test_dup_many ruby('-e', <<-'End') {|f| - lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0] - Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min) + if defined?(Process::RLIMIT_NOFILE) + lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0] + Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min) + end ok = 0 a = [] begin |