From 57e95f86be629449cba21e4d1893bb5e11214e5d Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 23 Feb 2012 10:57:55 +0000 Subject: [PATCH] * signal.c (sig_trap): show signal name on error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ signal.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8982f9883e..581d1d337e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 23 19:56:48 2012 Tanaka Akira + + * signal.c (sig_trap): show signal name on error. + Thu Feb 23 12:21:48 2012 Tanaka Akira * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of diff --git a/signal.c b/signal.c index 5e475bf9d3..08ce482ded 100644 --- a/signal.c +++ b/signal.c @@ -937,7 +937,11 @@ sig_trap(int argc, VALUE *argv) arg.sig = trap_signm(argv[0]); if (reserved_signal_p(arg.sig)) { - rb_raise(rb_eArgError, "can't trap reserved signal"); + const char *name = signo2signm(arg.sig); + if (name) + rb_raise(rb_eArgError, "can't trap reserved signal: SIG%s", name); + else + rb_raise(rb_eArgError, "can't trap reserved signal: %d", (int)arg.sig); } if (argc == 1) {