mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
process.c: handle dynamic :rlimit_* symbols in spawn execopts
* process.c (rb_execarg_addopt_rlimit): hoist out of rb_execarg_addopt (rlimit_type_by_sym): new wrapper for dynamic symbol (rb_execarg_addopt): check for dsym via rlimit_type_by_sym * test/ruby/test_process.rb (test_execopts_rlimit): check dsym w/o pindown Add extra check for bogus rlimit args, too. [ruby-core:82033] [Bug #13744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
24873d1a05
commit
5c4db58b12
2 changed files with 65 additions and 33 deletions
|
@ -242,6 +242,18 @@ class TestProcess < Test::Unit::TestCase
|
|||
:rlimit_core=>n, :rlimit_cpu=>3600]) {|io|
|
||||
assert_equal("[#{n}, #{n}]\n[3600, 3600]", io.read.chomp)
|
||||
}
|
||||
|
||||
assert_raise(ArgumentError) do
|
||||
system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
|
||||
end
|
||||
assert_separately([],<<-"end;") # [ruby-core:82033] [Bug #13744]
|
||||
assert(system("#{RUBY}", "-e",
|
||||
"exit([3600,3600] == Process.getrlimit(:CPU))",
|
||||
'rlimit_cpu'.to_sym => 3600))
|
||||
assert_raise(ArgumentError) do
|
||||
system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
|
||||
end
|
||||
end;
|
||||
end
|
||||
|
||||
MANDATORY_ENVS = %w[RUBYLIB]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue