no need to restore rlimit in child process.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-06 11:36:23 +00:00
parent 48823bbd01
commit fb128ef26f
1 changed files with 1 additions and 3 deletions

View File

@ -58,10 +58,9 @@ class TestProcess < Test::Unit::TestCase
return unless rlimit_exist?
with_tmpchdir {
write_file 's', <<-"End"
cur_nofile, max_nofile = Process.getrlimit(Process::RLIMIT_NOFILE)
result = 1
begin
Process.setrlimit(Process::RLIMIT_NOFILE, 0, max_nofile)
Process.setrlimit(Process::RLIMIT_NOFILE, 0)
rescue Errno::EINVAL
result = 0
end
@ -72,7 +71,6 @@ class TestProcess < Test::Unit::TestCase
result = 0
end
end
Process.setrlimit(Process::RLIMIT_NOFILE, cur_nofile, max_nofile)
exit result
End
pid = spawn RUBY, "s"