diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-27 12:27:13 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-27 12:27:13 +0000 |
commit | 4af243a8afa0dfefc74bb68dd08d9c5ff3ccc5d5 (patch) | |
tree | 00cb19ec62034715709fcf5d8856fc417e4badd8 /test | |
parent | 6fd326e76cba5fecda1470c808c6d8cc61d60381 (diff) | |
download | ruby-4af243a8afa0dfefc74bb68dd08d9c5ff3ccc5d5.tar.gz |
* eval.c (ruby_cleanup): before cleanup, check signal buffer and run
handler if any. [ruby-core:20970]
* thread.c (rb_threadptr_check_signal): separeted from
timer_thread_function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_signal.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 1ecf5401ab..5d9d3cd691 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -36,7 +36,7 @@ class TestSignal < Test::Unit::TestCase end def test_exit_action - return unless have_fork? # snip this test + return unless have_fork? # skip this test begin r, w = IO.pipe r0, w0 = IO.pipe @@ -166,4 +166,17 @@ class TestSignal < Test::Unit::TestCase Signal.trap(:INT, oldtrap) if oldtrap end end + + def test_kill_immediately_before_termination + return unless have_fork? # skip this test + + r, w = IO.pipe + pid = Process.fork do + r.close + Signal.trap(:USR1) { w.syswrite("foo") } + Process.kill :USR1, $$ + end + w.close + assert_equal(r.read, "foo") + end end |