summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:00:21 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:00:21 +0000
commit64f4114c2e5a164b5cb39976ddfac16ebb8f768c (patch)
tree46fac7c9f906933207f2f00ba09a7f0302e4a9bc
parent2c81a1fa523c27fcf9f5646a673537d15a955a28 (diff)
merge revision(s) 15476:
* configure.in (sigsetmask): check when signal semantics is not POSIX. * signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--configure.in3
-rw-r--r--signal.c22
-rw-r--r--version.h8
4 files changed, 27 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fa87c41dd0..a6fc52de985 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Jun 15 18:59:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (sigsetmask): check when signal semantics is not POSIX.
+
+ * signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is
+ available.
+
Sat Jun 14 16:12:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/timeout.rb (Timeout::timeout): made sensitive to location on the
diff --git a/configure.in b/configure.in
index d662e92d15e..c1195e2fecb 100644
--- a/configure.in
+++ b/configure.in
@@ -592,6 +592,7 @@ fi
if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
AC_DEFINE(POSIX_SIGNAL)
else
+ AC_CHECK_FUNCS(sigsetmask)
AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
[AC_TRY_RUN([
#include <stdio.h>
@@ -614,7 +615,7 @@ main()
],
rb_cv_bsd_signal=yes,
rb_cv_bsd_signal=no,
- rb_cv_bsd_signal=no)])
+ rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
if test "$rb_cv_bsd_signal" = yes; then
AC_DEFINE(BSD_SIGNAL)
fi
diff --git a/signal.c b/signal.c
index 82400e7addb..530bcc1164a 100644
--- a/signal.c
+++ b/signal.c
@@ -21,6 +21,12 @@
#undef SIGBUS
#endif
+#if defined HAVE_SIGPROCMASK || defined HAVE_SIGSETMASK
+#define USE_TRAP_MASK 1
+#else
+#define USE_TRAP_MASK 0
+#endif
+
#ifndef NSIG
# ifdef DJGPP
# define NSIG SIGMAX
@@ -570,7 +576,7 @@ rb_trap_exec()
}
struct trap_arg {
-#ifndef _WIN32
+#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
sigset_t mask;
# else
@@ -716,7 +722,7 @@ trap(arg)
trap_list[sig].cmd = command;
trap_list[sig].safe = ruby_safe_level;
/* enable at least specified signal. */
-#ifndef _WIN32
+#if USE_TRAP_MASK
#ifdef HAVE_SIGPROCMASK
sigdelset(&arg->mask, sig);
#else
@@ -726,7 +732,7 @@ trap(arg)
return oldcmd;
}
-#ifndef _WIN32
+#if USE_TRAP_MASK
static VALUE
trap_ensure(arg)
struct trap_arg *arg;
@@ -745,7 +751,7 @@ trap_ensure(arg)
void
rb_trap_restore_mask()
{
-#ifndef _WIN32
+#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
sigprocmask(SIG_SETMASK, &trap_last_mask, NULL);
# else
@@ -805,7 +811,7 @@ sig_trap(argc, argv)
if (OBJ_TAINTED(arg.cmd)) {
rb_raise(rb_eSecurityError, "Insecure: tainted signal trap");
}
-#ifndef _WIN32
+#if USE_TRAP_MASK
/* disable interrupt */
# ifdef HAVE_SIGPROCMASK
sigfillset(&arg.mask);
@@ -888,7 +894,7 @@ init_sigchld(sig)
int sig;
{
sighandler_t oldfunc;
-#ifndef _WIN32
+#if USE_TRAP_MASK
# ifdef HAVE_SIGPROCMASK
sigset_t mask;
# else
@@ -896,7 +902,7 @@ init_sigchld(sig)
# endif
#endif
-#ifndef _WIN32
+#if USE_TRAP_MASK
/* disable interrupt */
# ifdef HAVE_SIGPROCMASK
sigfillset(&mask);
@@ -913,7 +919,7 @@ init_sigchld(sig)
trap_list[sig].cmd = 0;
}
-#ifndef _WIN32
+#if USE_TRAP_MASK
#ifdef HAVE_SIGPROCMASK
sigdelset(&mask, sig);
sigprocmask(SIG_SETMASK, &mask, NULL);
diff --git a/version.h b/version.h
index f5705c1eb57..b8b3a16e050 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.5"
-#define RUBY_RELEASE_DATE "2008-06-14"
+#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
-#define RUBY_RELEASE_CODE 20080614
-#define RUBY_PATCHLEVEL 175
+#define RUBY_RELEASE_CODE 20080615
+#define RUBY_PATCHLEVEL 176
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 5
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 14
+#define RUBY_RELEASE_DAY 15
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];