diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-09 08:30:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-09 08:30:24 +0000 |
commit | 9f4db3bcdbfc485fc49a934d0f1652542e27b7ec (patch) | |
tree | fcac8ee54f6db89615214ec506c1f02a5f88fc6b | |
parent | 39fbb2ea5f71e1f829532adaced07aa5eacdf58e (diff) | |
download | ruby-9f4db3bcdbfc485fc49a934d0f1652542e27b7ec.tar.gz |
signal.c: warn at unresserved signals
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | signal.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1386,7 +1386,10 @@ sig_list(void) return h; } -#define install_sighandler_fail(signum) rb_bug("failed to install "signum" handler") +#define install_sighandler_fail(signame, signum) \ + (reserved_signal_p(signum) ? \ + rb_bug("failed to install "signame" handler") : \ + perror("failed to install "signame" handler")) static int install_sighandler(int signum, sighandler_t handler) { @@ -1402,8 +1405,8 @@ install_sighandler(int signum, sighandler_t handler) } #ifndef __native_client__ # define install_sighandler(signum, handler) \ - (install_sighandler(signum, handler) && reserved_signal_p(signum) ? \ - install_sighandler_fail(#signum) : (void)0) + (install_sighandler(signum, handler) ? \ + install_sighandler_fail(#signum, signum) : (void)0) #endif #if defined(SIGCLD) || defined(SIGCHLD) @@ -1424,7 +1427,7 @@ init_sigchld(int sig) } # ifndef __native_client__ # define init_sigchld(signum) \ - (init_sigchld(signum) ? install_sighandler_fail(#signum) : (void)0) + (init_sigchld(signum) ? install_sighandler_fail(#signum, signum) : (void)0) # endif #endif |