summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-13 02:43:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-13 02:43:52 +0000
commit35e17cbe214a6cd81122aa1a8dfa8c0d832f093d (patch)
tree0ef50b9f191636b0821caa824ba1a79346dcfa64
parent0cde80d36a498655f3a6cdc792130e7f39fbe776 (diff)
* 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
-rw-r--r--test/ruby/test_process.rb8
1 files 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)