diff --git a/ChangeLog b/ChangeLog index acf9a160ed..cb03e2df6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 21 12:15:32 2015 Kimura Wataru + + * test/ruby/test_io.rb: handled rlimit value same as r52277 + [Bug #11852][ruby-dev:49446] + Mon Dec 21 10:21:22 2015 Ilya Vassilevsky * lib/net/http.rb (open_timeout): update default value in RDoc diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 723858a0b8..766804eb2e 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1094,7 +1094,10 @@ class TestIO < Test::Unit::TestCase args = ['-e', '$>.write($<.read)'] if args.empty? ruby = EnvUtil.rubybin opts = {} - opts[:rlimit_nproc] = 1024 if defined?(Process::RLIMIT_NPROC) + if defined?(Process::RLIMIT_NPROC) + lim = Process.getrlimit(Process::RLIMIT_NPROC)[1] + opts[:rlimit_nproc] = [lim, 1024].min + end f = IO.popen([ruby] + args, 'r+', opts) pid = f.pid yield(f)