diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 02:43:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 02:43:52 +0000 |
commit | 0b0631d2a55d928d8320fc36abe93bd19ed5709b (patch) | |
tree | 0ef50b9f191636b0821caa824ba1a79346dcfa64 | |
parent | 1750b4e0883ea223d5b692f1415b066723580145 (diff) | |
download | ruby-0b0631d2a55d928d8320fc36abe93bd19ed5709b.tar.gz ruby-0b0631d2a55d928d8320fc36abe93bd19ed5709b.tar.xz ruby-0b0631d2a55d928d8320fc36abe93bd19ed5709b.zip |
* test/ruby/test_process.rb (test_rlimit_value): rlim_max may be
higher than rlim_cur.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_process.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 4e6097bbc..752d28d62 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) |