From 46c64caff68dd536eeeaa1c945eb66b886a0721d Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 22 May 2015 10:42:09 +0000 Subject: process.c: do not discard status * process.c (rb_spawn_process): do not discard global escape status. [ruby-core:69304] [Bug #11166] * process.c (rb_execarg_spawn): extract the start procedure in a parent process with ensuring the end procedure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index ac5091b278..a43dcf475c 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2017,4 +2017,16 @@ EOS status = th.value assert status.success?, status.inspect end if defined?(fork) + + def test_kill_at_spawn_failure + bug11166 = '[ruby-core:69304] [Bug #11166]' + th = nil + x = with_tmpchdir {|d| + prog = "#{d}/notexist" + th = Thread.start {system(prog);sleep} + th.kill + th.join(0.1) + } + assert_equal(th, x) + end if defined?(fork) end -- cgit v1.2.3