[前][次][番号順一覧][スレッド一覧]

ruby-changes:26223

From: nobu <ko1@a...>
Date: Sun, 9 Dec 2012 23:36:59 +0900 (JST)
Subject: [ruby-changes:26223] nobu:r38280 (trunk): envutil.rb: kill child

nobu	2012-12-09 23:34:33 +0900 (Sun, 09 Dec 2012)

  New Revision: 38280

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38280

  Log:
    envutil.rb: kill child
    
    * test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill the child process
      certainly.

  Modified files:
    trunk/test/ruby/envutil.rb

Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 38279)
+++ test/ruby/envutil.rb	(revision 38280)
@@ -44,6 +44,7 @@
       err_p.set_encoding(enc) if err_p
     end
     timeout = opt.delete(:timeout) || 10
+    reprieve = opt.delete(:reprieve) || 1
     c = "C"
     child_env = {}
     LANG_ENVS.each {|lc| child_env[lc] = c}
@@ -70,7 +71,9 @@
         begin
           Process.kill signal, pid
         rescue Errno::ESRCH
-        end
+          break
+        else
+        end until signal == :KILL or (sleep reprieve; signal = :KILL; false)
         raise Timeout::Error
       end
       out_p.close if capture_stdout

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]