ruby-changes:46936
From: nobu <ko1@a...>
Date: Fri, 9 Jun 2017 17:30:30 +0900 (JST)
Subject: [ruby-changes:46936] nobu:r59051 (trunk): signal.c: warn at unresserved signals
nobu 2017-06-09 17:30:24 +0900 (Fri, 09 Jun 2017) New Revision: 59051 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59051 Log: signal.c: warn at unresserved signals Modified files: trunk/signal.c Index: signal.c =================================================================== --- signal.c (revision 59050) +++ signal.c (revision 59051) @@ -1386,7 +1386,10 @@ sig_list(void) https://github.com/ruby/ruby/blob/trunk/signal.c#L1386 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, sighandle https://github.com/ruby/ruby/blob/trunk/signal.c#L1405 } #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) https://github.com/ruby/ruby/blob/trunk/signal.c#L1427 } # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/