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

ruby-changes:43689

From: nobu <ko1@a...>
Date: Wed, 27 Jul 2016 01:23:00 +0900 (JST)
Subject: [ruby-changes:43689] nobu:r55762 (trunk): dtrace: wait command

nobu	2016-07-27 01:22:56 +0900 (Wed, 27 Jul 2016)

  New Revision: 55762

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55762

  Log:
    dtrace: wait command
    
    * test/dtrace/helper.rb (DTrace::TestCase::READ_PROBES): wait
      the spawned command not to make a waiter thread.  fix up r55736.

  Modified files:
    trunk/test/dtrace/helper.rb
Index: test/dtrace/helper.rb
===================================================================
--- test/dtrace/helper.rb	(revision 55761)
+++ test/dtrace/helper.rb	(revision 55762)
@@ -31,9 +31,12 @@ module DTrace https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L31
       DTRACE_CMD = %w[dtrace -b 8m]
     when /darwin/i
       READ_PROBES = proc do |cmd|
-        PTY.spawn(*cmd) do |io, _|
-          break io.readlines.each {|line| line.sub!(/\r$/, "")}
+        lines = nil
+        PTY.spawn(*cmd) do |io, _, pid|
+          lines = io.readlines.each {|line| line.sub!(/\r$/, "")}
+          Process.wait(pid)
         end
+        lines
       end
     end
 

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

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