From b933b073d86575335e6e3b55f9ea0424e4c99e95 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 29 Dec 2008 14:41:22 +0000 Subject: * process.c (rb_waitpid): retries waitpid when EINTR. [ruby-core:19744]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 97b48827b..1e7b63a47 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1044,4 +1044,16 @@ class TestProcess < Test::Unit::TestCase def test_pst_inspect assert_nothing_raised { Process::Status.allocate.inspect } end + + def test_wait_and_sigchild + signal_received = [] + Signal.trap(:CHLD) { signal_received << true; puts "child died" } + pid = fork { sleep 1; exit } + Thread.start { raise } + Process.wait pid + sleep 2 + assert_equal [true], signal_received, " [ruby-core:19744]" + ensure + Signal.trap(:CHLD, 'DEFAULT') + end end -- cgit