ruby-changes:36803
From: usa <ko1@a...>
Date: Thu, 18 Dec 2014 14:27:10 +0900 (JST)
Subject: [ruby-changes:36803] usa:r48884 (trunk): * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT,
usa 2014-12-18 14:26:57 +0900 (Thu, 18 Dec 2014) New Revision: 48884 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48884 Log: * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT, should be treated before calling signal(2). [Bug #10615] Modified files: trunk/ChangeLog trunk/signal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 48883) +++ ChangeLog (revision 48884) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Dec 18 14:25:17 2014 NAKAMURA Usaku <usa@r...> + + * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT, + should be treated before calling signal(2). + [Bug #10615] + Wed Dec 17 12:20:56 2014 Nobuyoshi Nakada <nobu@r...> * compile.c (rb_method_for_self_aref, rb_method_for_self_aset): Index: signal.c =================================================================== --- signal.c (revision 48883) +++ signal.c (revision 48884) @@ -634,6 +634,17 @@ posix_signal(int signum, sighandler_t ha https://github.com/ruby/ruby/blob/trunk/signal.c#L634 return ruby_signal(signum, handler); } +#elif defined _WIN32 +static inline sighandler_t +ruby_signal(int signum, sighandler_t handler) +{ + if (signum == SIGKILL) { + errno = EINVAL; + return SIG_ERR; + } + return signal(signum, handler); +} + #else /* !POSIX_SIGNAL */ #define ruby_signal(sig,handler) (/* rb_trap_accept_nativethreads[(sig)] = 0,*/ signal((sig),(handler))) #if 0 /* def HAVE_NATIVETHREAD */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/