aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_io.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 133a1a34a1..634a1731be 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1081,7 +1081,7 @@ class TestIO < Test::Unit::TestCase
args = ['-e', '$>.write($<.read)'] if args.empty?
ruby = EnvUtil.rubybin
opts = {}
- opts[:rlimit_nproc] = 1024 if /mswin|mingw/ =~ RUBY_PLATFORM
+ opts[:rlimit_nproc] = 1024 if defined?(Process::RLIMIT_NPROC)
f = IO.popen([ruby] + args, 'r+', opts)
pid = f.pid
yield(f)