ruby-changes:23956
From: akr <ko1@a...>
Date: Sun, 10 Jun 2012 11:45:47 +0900 (JST)
Subject: [ruby-changes:23956] akr:r36007 (trunk): * process.c (rb_fork_internal): call after_fork only unless
akr 2012-06-10 11:45:38 +0900 (Sun, 10 Jun 2012) New Revision: 36007 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36007 Log: * process.c (rb_fork_internal): call after_fork only unless chfunc_is_async_signal_safe. Modified files: trunk/ChangeLog trunk/process.c trunk/test/ruby/test_process.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36006) +++ ChangeLog (revision 36007) @@ -1,3 +1,8 @@ +Sun Jun 10 11:44:57 2012 Tanaka Akira <akr@f...> + + * process.c (rb_fork_internal): call after_fork only unless + chfunc_is_async_signal_safe. + Sun Jun 10 11:33:01 2012 Martin Bosslet <Martin.Bosslet@g...> * ext/openssl/ossl_pkey_ec.c Index: process.c =================================================================== --- process.c (revision 36006) +++ process.c (revision 36007) @@ -2945,7 +2945,8 @@ _exit(127); #endif } - after_fork(); + if (!chfunc_is_async_signal_safe) + after_fork(); close(ep[1]); error_occured = recv_child_error(ep[0], &state, &exc, &err, errmsg, errmsg_buflen, chfunc_is_async_signal_safe); if (state || error_occured) { Index: test/ruby/test_process.rb =================================================================== --- test/ruby/test_process.rb (revision 36006) +++ test/ruby/test_process.rb (revision 36007) @@ -1424,4 +1424,13 @@ assert_nothing_raised { spawn(*TRUECOMMAND, :new_pgroup=>true) } assert_nothing_raised { IO.popen([*TRUECOMMAND, :new_pgroup=>true]) {} } end + + def test_sigpipe + system(RUBY, "-e", "") + with_pipe {|r, w| + r.close + assert_raise(Errno::EPIPE) { w.print "a" } + } + end + end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/