summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-18 05:26:57 (GMT)
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-18 05:26:57 (GMT)
commit42496f2f3391c42c955fb492444fdc482f35cb61 (patch)
tree0542da056448b2bfc3aaa534b7ae943eebd3d8da /signal.c
parent3bd4d51149d2fdac159a86cf836493accf328ecc (diff)
* signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT,
should be treated before calling signal(2). [Bug #10615] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index 6799085..c9e6ffd 100644
--- a/signal.c
+++ b/signal.c
@@ -634,6 +634,17 @@ posix_signal(int signum, sighandler_t handler)
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 */