summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-28 10:42:25 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-28 10:42:25 +0000
commit0148d41a13f0ce7ec5a83f93984fe7aaf9c0e2d2 (patch)
tree2ee0173b20f9e6d680988d693c7d9fc7e2b4a00e /signal.c
parent4870feb31a6625dcbf8817ccf16294bb3f3737e1 (diff)
* signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.
The code have already depended on pthread_sigmask since r27464. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/signal.c b/signal.c
index 774cdad303..6c4028e789 100644
--- a/signal.c
+++ b/signal.c
@@ -32,7 +32,7 @@ ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val)
#undef SIGBUS
#endif
-#if defined HAVE_SIGPROCMASK || defined HAVE_SIGSETMASK
+#ifdef HAVE_PTHREAD_SIGMASK
#define USE_TRAP_MASK 1
#else
#define USE_TRAP_MASK 0
@@ -520,11 +520,7 @@ rb_signal_buff_size(void)
}
#if USE_TRAP_MASK
-# ifdef HAVE_SIGPROCMASK
static sigset_t trap_last_mask;
-# else
-static int trap_last_mask;
-# endif
#endif
#if HAVE_PTHREAD_H
@@ -670,11 +666,7 @@ rb_signal_exec(rb_thread_t *th, int sig)
struct trap_arg {
#if USE_TRAP_MASK
-# ifdef HAVE_SIGPROCMASK
sigset_t mask;
-# else
- int mask;
-# endif
#endif
int sig;
sighandler_t func;
@@ -854,11 +846,7 @@ trap(struct trap_arg *arg)
vm->trap_list[sig].safe = rb_safe_level();
/* enable at least specified signal. */
#if USE_TRAP_MASK
-#ifdef HAVE_SIGPROCMASK
sigdelset(&arg->mask, sig);
-#else
- arg->mask &= ~sigmask(sig);
-#endif
#endif
return oldcmd;
}
@@ -989,16 +977,9 @@ init_sigchld(int sig)
{
sighandler_t oldfunc;
#if USE_TRAP_MASK
-# ifdef HAVE_SIGPROCMASK
sigset_t mask;
sigset_t fullmask;
-# else
- int mask;
- int fullmask;
-# endif
-#endif
-#if USE_TRAP_MASK
/* disable interrupt */
sigfillset(&fullmask);
pthread_sigmask(SIG_BLOCK, &fullmask, &mask);