summaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-27 07:12:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-27 07:12:35 +0000
commit80a1277da3439d1388ae89a210e78eab859041b3 (patch)
tree27596b62ff70caeee57c0b31bd0913b4fb037a89 /signal.c
parent09cf92d1ee860c3b9f704bd956c380b41a59418d (diff)
downloadruby-80a1277da3439d1388ae89a210e78eab859041b3.tar.gz
ruby-80a1277da3439d1388ae89a210e78eab859041b3.tar.xz
ruby-80a1277da3439d1388ae89a210e78eab859041b3.zip
* signal.c (ruby_sigaction_t): added.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/signal.c b/signal.c
index e16308eeb..a3ee4eb23 100644
--- a/signal.c
+++ b/signal.c
@@ -408,6 +408,13 @@ static struct {
#endif
typedef RETSIGTYPE (*sighandler_t)(int);
+#ifdef SA_SIGINFO
+typedef void ruby_sigaction_t(int, siginfo_t*, void*);
+#define SIGINFO_ARG , siginfo_t *info, void *ctx
+#else
+typedef RETSIGTYPE ruby_sigaction_t(int);
+#define SIGINFO_ARG
+#endif
#ifdef POSIX_SIGNAL
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
@@ -415,7 +422,6 @@ typedef RETSIGTYPE (*sighandler_t)(int);
#endif
#ifdef USE_SIGALTSTACK
-#define SIGINFO_ARG , siginfo_t *info, void *ctx
#ifdef SIGSTKSZ
#define ALT_STACK_SIZE (SIGSTKSZ*2)
#else
@@ -442,8 +448,6 @@ register_sigaltstack()
rb_bug("register_sigaltstack. error\n");
is_altstack_defined = 1;
}
-#else
-#define SIGINFO_ARG
#endif
static sighandler_t
@@ -457,7 +461,7 @@ ruby_signal(int signum, sighandler_t handler)
sigemptyset(&sigact.sa_mask);
#ifdef SA_SIGINFO
- sigact.sa_sigaction = (void (*)(int, siginfo_t*, void*))handler;
+ sigact.sa_sigaction = (ruby_sigaction_t*)handler;
sigact.sa_flags = SA_SIGINFO;
#else
sigact.sa_handler = handler;