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

ruby-changes:19987

From: naruse <ko1@a...>
Date: Mon, 13 Jun 2011 03:20:34 +0900 (JST)
Subject: [ruby-changes:19987] naruse:r32034 (trunk): Ignore exception from Process.kill.

naruse	2011-06-13 03:20:25 +0900 (Mon, 13 Jun 2011)

  New Revision: 32034

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

  Log:
    Ignore exception from Process.kill.
    
    On NetBSD this usually raises Errno::ESRCH.
    Of course, the process is already finished and should be ignored.

  Modified files:
    trunk/test/testunit/test_parallel.rb

Index: test/testunit/test_parallel.rb
===================================================================
--- test/testunit/test_parallel.rb	(revision 32033)
+++ test/testunit/test_parallel.rb	(revision 32034)
@@ -27,7 +27,10 @@
             Process.waitpid(@worker_pid)
           end
         rescue IOError, Errno::EPIPE, Timeout::Error
-          Process.kill(:KILL, @worker_pid)
+          begin
+            Process.kill(:KILL, @worker_pid)
+          rescue Errno::ESRCH
+          end
         end
       end
     end

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

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