summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-01 06:49:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-01 06:49:34 +0000
commit13a79948fee9877d3f946c11a0fd9b5d4366e9c3 (patch)
treebfc07d3474b6f0e451faf0c38a7bf2a31f6b0086 /signal.c
parenta918afe05e2f3534e262d16827f94463e021f096 (diff)
* signal.c (register_sigaltstack): no need to define on non-sigaltstack
platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/signal.c b/signal.c
index 1dfff89b46..cb2fcb3557 100644
--- a/signal.c
+++ b/signal.c
@@ -446,8 +446,6 @@ register_sigaltstack(void)
if (sigaltstack(&newSS, &oldSS) < 0)
rb_bug("register_sigaltstack. error\n");
}
-#else
-#define register_sigaltstack() ((void)0)
#endif
static sighandler_t
@@ -716,7 +714,9 @@ default_handler(int sig)
#ifdef SIGSEGV
case SIGSEGV:
func = (sighandler_t)sigsegv;
+# ifdef USE_SIGALTSTACK
register_sigaltstack();
+# endif
break;
#endif
#ifdef SIGPIPE
@@ -1124,7 +1124,9 @@ Init_signal(void)
install_sighandler(SIGBUS, sigbus);
#endif
#ifdef SIGSEGV
+# ifdef USE_SIGALTSTACK
register_sigaltstack();
+# endif
install_sighandler(SIGSEGV, (sighandler_t)sigsegv);
#endif
}