diff options
-rw-r--r-- | signal.c | 6 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 15 |
2 files changed, 21 insertions, 0 deletions
@@ -465,6 +465,12 @@ rb_f_kill(int argc, VALUE *argv) #ifdef SIGBUS case SIGBUS: #endif +#ifdef SIGKILL + case SIGKILL: +#endif +#ifdef SIGSTOP + case SIGSTOP: +#endif ruby_kill(pid, sig); break; default: diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 94fda02ebb..5abc5bca0b 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1201,6 +1201,21 @@ class TestProcess < Test::Unit::TestCase def test_status_kill return unless Process.respond_to?(:kill) + return unless Signal.list.include?("KILL") + + with_tmpchdir do + write_file("foo", "Process.kill(:KILL, $$); exit(42)") + system(RUBY, "foo") + s = $? + assert_equal([false, true, false, nil], + [s.exited?, s.signaled?, s.stopped?, s.success?], + "[s.exited?, s.signaled?, s.stopped?, s.success?]") + assert_equal(false, s.exited?) + end + end + + def test_status_quit + return unless Process.respond_to?(:kill) return unless Signal.list.include?("QUIT") with_tmpchdir do |