mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
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
This commit is contained in:
parent
63bbbdb6fb
commit
0a4a5b20db
1 changed files with 3 additions and 1 deletions
|
@ -57,11 +57,13 @@ class TestProcess < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_rlimit_nofile
|
def test_rlimit_nofile
|
||||||
return unless rlimit_exist?
|
return unless rlimit_exist?
|
||||||
|
limit = /openbsd/ =~ RUBY_PLATFORM ? 1 : 0
|
||||||
|
# if limit=0, this test freeze pn OpenBSD
|
||||||
with_tmpchdir {
|
with_tmpchdir {
|
||||||
write_file 's', <<-"End"
|
write_file 's', <<-"End"
|
||||||
result = 1
|
result = 1
|
||||||
begin
|
begin
|
||||||
Process.setrlimit(Process::RLIMIT_NOFILE, 0)
|
Process.setrlimit(Process::RLIMIT_NOFILE, limit)
|
||||||
rescue Errno::EINVAL
|
rescue Errno::EINVAL
|
||||||
result = 0
|
result = 0
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue