From 35e17cbe214a6cd81122aa1a8dfa8c0d832f093d Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 13 Sep 2009 02:43:52 +0000 Subject: [PATCH] * test/ruby/test_process.rb (test_rlimit_value): rlim_max may be higher than rlim_cur. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 4e6097bbc1..752d28d62c 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -110,21 +110,21 @@ class TestProcess < Test::Unit::TestCase with_tmpchdir do s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) - Process.setrlimit(:NOFILE, max-10) + Process.setrlimit(:NOFILE, [max-10, cur].min) begin Process.setrlimit(:NOFILE, :INFINITY) rescue Errno::EPERM - exit 1 + exit false end End assert_not_equal(0, s.exitstatus) s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) - Process.setrlimit(:NOFILE, max-10) + Process.setrlimit(:NOFILE, [max-10, cur].min) begin Process.setrlimit(:NOFILE, "INFINITY") rescue Errno::EPERM - exit 1 + exit false end End assert_not_equal(0, s.exitstatus)