From 71f656e40de99d240c873ebb23451f76e46e5a20 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Sep 2013 22:47:20 +0000 Subject: [PATCH] test_poll: preserve original trap(:USR1) handler The existing SIGUSR1 handler may not always be "DEFAULT", so restore the original one. --- test/test_poll.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_poll.rb b/test/test_poll.rb index 13f5f2a..5bfc70b 100644 --- a/test/test_poll.rb +++ b/test/test_poll.rb @@ -114,7 +114,7 @@ class TestPoll < Test::Unit::TestCase empty = 0 nr = 100 set = { @rd => Kgio::POLLIN } - trap(:USR1) { usr1 += 1 } + orig = trap(:USR1) { usr1 += 1 } pid = fork do trap(:USR1, "DEFAULT") sleep 0.1 @@ -129,6 +129,6 @@ class TestPoll < Test::Unit::TestCase assert status.success?, status.inspect assert usr1 > 0, "usr1: #{usr1}" ensure - trap(:USR1, "DEFAULT") + trap(:USR1, orig) end unless RUBY_PLATFORM =~ /kfreebsd-gnu/ end if Kgio.respond_to?(:poll) -- 2.11.4.GIT