diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-29 07:17:35 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-29 07:17:35 +0000 |
commit | 0a4a5b20db3db69fd62804030f3f1008c83d89a6 (patch) | |
tree | f238eeca29182fba83ca7187ede062c91c701b1f /test/ruby | |
parent | 63bbbdb6fb1b40b76547c777c3a50bb5d628105b (diff) | |
download | ruby-0a4a5b20db3db69fd62804030f3f1008c83d89a6.tar.gz |
Use setrlimit(NOFILE,1) on OpenBSD.
Because on OpenBSD it freezes if limit=0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_process.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index ba3aeb9825..8f1ecde398 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -57,11 +57,13 @@ class TestProcess < Test::Unit::TestCase def test_rlimit_nofile return unless rlimit_exist? + limit = /openbsd/ =~ RUBY_PLATFORM ? 1 : 0 + # if limit=0, this test freeze pn OpenBSD with_tmpchdir { write_file 's', <<-"End" result = 1 begin - Process.setrlimit(Process::RLIMIT_NOFILE, 0) + Process.setrlimit(Process::RLIMIT_NOFILE, limit) rescue Errno::EINVAL result = 0 end |