зеркало из https://github.com/github/ruby.git
* signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5d488225a4
Коммит
08928bb528
|
@ -1,3 +1,7 @@
|
|||
Sat May 10 08:47:36 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.
|
||||
|
||||
Fri May 9 14:27:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (RUBY_SETJMP_TYPE): check for setjmp type after
|
||||
|
|
1
signal.c
1
signal.c
|
@ -976,6 +976,7 @@ trap(int sig, sighandler_t func, VALUE command)
|
|||
switch (oldcmd) {
|
||||
case 0:
|
||||
if (oldfunc == SIG_IGN) oldcmd = rb_str_new2("IGNORE");
|
||||
else if (oldfunc == SIG_DFL) oldcmd = rb_str_new2("SYSTEM_DEFAULT");
|
||||
else if (oldfunc == sighandler) oldcmd = rb_str_new2("DEFAULT");
|
||||
else oldcmd = Qnil;
|
||||
break;
|
||||
|
|
|
@ -175,6 +175,13 @@ class TestSignal < Test::Unit::TestCase
|
|||
end;
|
||||
end if Process.respond_to?(:kill)
|
||||
|
||||
def test_trap_system_default
|
||||
assert_separately([], <<-End)
|
||||
trap(:QUIT, "SYSTEM_DEFAULT")
|
||||
assert_equal("SYSTEM_DEFAULT", trap(:QUIT, "DEFAULT"))
|
||||
End
|
||||
end
|
||||
|
||||
def test_signal_requiring
|
||||
t = Tempfile.new(%w"require_ensure_test .rb")
|
||||
t.puts "sleep"
|
||||
|
|
Загрузка…
Ссылка в новой задаче