envutil.rb: kill pgroup
* test/lib/envutil.rb (invoke_ruby): kill whole group when :pgroup option is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c13fedf33d
commit
a88e787277
@ -68,8 +68,14 @@ module EnvUtil
|
|||||||
stderr = th_stderr.value if capture_stderr && capture_stderr != :merge_to_stdout
|
stderr = th_stderr.value if capture_stderr && capture_stderr != :merge_to_stdout
|
||||||
else
|
else
|
||||||
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM
|
signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM
|
||||||
|
case pgroup = opt[:pgroup]
|
||||||
|
when 0, true
|
||||||
|
pgroup = -pid
|
||||||
|
when nil, false
|
||||||
|
pgroup = pid
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
Process.kill signal, pid
|
Process.kill signal, pgroup
|
||||||
Timeout.timeout((reprieve unless signal == :KILL)) do
|
Timeout.timeout((reprieve unless signal == :KILL)) do
|
||||||
Process.wait(pid)
|
Process.wait(pid)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user