mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@15476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
67d0ce36f5
commit
82f631ac57
4 changed files with 26 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Feb 15 02:40:54 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.
|
||||
|
||||
Thu Feb 14 23:56:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval_error.c (error_print): append a newline to rest lines.
|
||||
|
|
|
@ -770,6 +770,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>
|
||||
|
@ -792,7 +793,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
|
||||
|
|
22
signal.c
22
signal.c
|
@ -22,6 +22,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
|
||||
|
@ -629,7 +635,7 @@ rb_trap_exec(void)
|
|||
}
|
||||
|
||||
struct trap_arg {
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
sigset_t mask;
|
||||
# else
|
||||
|
@ -813,7 +819,7 @@ trap(struct trap_arg *arg)
|
|||
|
||||
trap_list[sig].cmd = command;
|
||||
/* enable at least specified signal. */
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
sigdelset(&arg->mask, sig);
|
||||
#else
|
||||
|
@ -823,7 +829,7 @@ trap(struct trap_arg *arg)
|
|||
return oldcmd;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
static VALUE
|
||||
trap_ensure(struct trap_arg *arg)
|
||||
{
|
||||
|
@ -841,7 +847,7 @@ trap_ensure(struct trap_arg *arg)
|
|||
void
|
||||
rb_trap_restore_mask(void)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
sigprocmask(SIG_SETMASK, &trap_last_mask, NULL);
|
||||
# else
|
||||
|
@ -904,7 +910,7 @@ sig_trap(int argc, VALUE *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);
|
||||
|
@ -955,7 +961,7 @@ static void
|
|||
init_sigchld(int sig)
|
||||
{
|
||||
sighandler_t oldfunc;
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
sigset_t mask;
|
||||
# else
|
||||
|
@ -963,7 +969,7 @@ init_sigchld(int sig)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
/* disable interrupt */
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
sigfillset(&mask);
|
||||
|
@ -980,7 +986,7 @@ init_sigchld(int sig)
|
|||
trap_list[sig].cmd = 0;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
#if USE_TRAP_MASK
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
sigdelset(&mask, sig);
|
||||
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2008-02-14"
|
||||
#define RUBY_RELEASE_DATE "2008-02-15"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20080214
|
||||
#define RUBY_RELEASE_CODE 20080215
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2008
|
||||
#define RUBY_RELEASE_MONTH 2
|
||||
#define RUBY_RELEASE_DAY 14
|
||||
#define RUBY_RELEASE_DAY 15
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Reference in a new issue