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

ruby-changes:36023

From: normal <ko1@a...>
Date: Thu, 23 Oct 2014 10:37:02 +0900 (JST)
Subject: [ruby-changes:36023] normal:r48104 (trunk): test/ruby/test_process.rb: ensure exit! on fork failure

normal	2014-10-23 10:36:55 +0900 (Thu, 23 Oct 2014)

  New Revision: 48104

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

  Log:
    test/ruby/test_process.rb: ensure exit! on fork failure
    
    * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
      ensure exit! on fork failure

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_process.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48103)
+++ ChangeLog	(revision 48104)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Oct 23 10:22:24 2014  Eric Wong  <e@8...>
+
+	* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+	  ensure exit! during fork failure
+
 Thu Oct 23 10:21:21 2014  Martin Duerst <duerst@i...>
 
 	* NEWS: Added String#unicode_normalize(|!|d?) [ci skip]
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 48103)
+++ test/ruby/test_process.rb	(revision 48104)
@@ -1922,6 +1922,7 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1922
     er, ew = IO.pipe
     unless runner = IO.popen("-")
       er.close
+      status = true
       begin
         $stderr.reopen($stdout)
         trap(:QUIT) {}
@@ -1934,10 +1935,13 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1935
           $stdout.flush
         end
       ensure
-        ew.puts([Marshal.dump($!)].pack("m0")) if $!
+        if $!
+          ew.puts([Marshal.dump($!)].pack("m0"))
+          status = false
+        end
         ew.close
+        exit!(status)
       end
-      exit!(true)
     end
     ew.close
     begin

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

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