1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* intern.h, eval.c (rb_thread_signal_raise): costified.

* signal.c: cosmetic change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-11-08 08:49:45 +00:00
parent 9e55ce1068
commit 59ffb8a846
4 changed files with 18 additions and 22 deletions

View file

@ -1,3 +1,9 @@
Tue Nov 8 17:35:53 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* intern.h, eval.c (rb_thread_signal_raise): costified.
* signal.c: cosmetic change.
Tue Nov 8 15:32:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/drb/ssl.rb (DRb::SSLConfig#accept): fixed typo.

6
eval.c
View file

@ -10014,7 +10014,7 @@ static VALUE th_raise_exception;
static NODE *th_raise_node;
static VALUE th_cmd;
static int th_sig, th_safe;
static char *th_signm;
static const char *th_signm;
#define RESTORE_NORMAL 1
#define RESTORE_FATAL 2
@ -12101,7 +12101,7 @@ rb_thread_interrupt(void)
}
void
rb_thread_signal_raise(char *sig)
rb_thread_signal_raise(const char *sig)
{
if (sig == 0) return; /* should not happen */
rb_thread_critical = 0;
@ -12115,7 +12115,7 @@ rb_thread_signal_raise(char *sig)
return;
}
}
th_signm = sig;
th_signm = sig; /* should be literal */
curr_thread = main_thread;
rb_thread_restore_context(curr_thread, RESTORE_SIGNAL);
}

View file

@ -273,7 +273,7 @@ VALUE rb_thread_kill(VALUE);
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
void rb_thread_interrupt(void);
void rb_thread_trap_eval(VALUE, int, int);
void rb_thread_signal_raise(char*);
void rb_thread_signal_raise(const char*); /* should pass literal */
void rb_thread_signal_exit(void);
int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
void rb_thread_wait_for(struct timeval);

View file

@ -30,7 +30,7 @@
#endif
static struct signals {
char *signm;
const char *signm;
int signo;
} siglist [] = {
{"EXIT", 0},
@ -169,7 +169,7 @@ static struct signals {
};
static int
signm2signo(char *nm)
signm2signo(const char *nm)
{
struct signals *sigs;
@ -179,7 +179,7 @@ signm2signo(char *nm)
return 0;
}
static char*
static const char*
signo2signm(int no)
{
struct signals *sigs;
@ -325,9 +325,7 @@ typedef RETSIGTYPE (*sighandler_t)(int);
#ifdef POSIX_SIGNAL
static sighandler_t
ruby_signal(signum, handler)
int signum;
sighandler_t handler;
ruby_signal(int signum, sighandler_t handler)
{
struct sigaction sigact, old;
@ -345,18 +343,14 @@ ruby_signal(signum, handler)
}
void
posix_signal(signum, handler)
int signum;
sighandler_t handler;
posix_signal(int signum, sighandler_t handler)
{
ruby_signal(signum, handler);
}
#ifdef HAVE_NATIVETHREAD
static sighandler_t
ruby_nativethread_signal(signum, handler)
int signum;
sighandler_t handler;
ruby_nativethread_signal(int signum, sighandler_t handler)
{
sighandler_t old;
@ -366,9 +360,7 @@ ruby_nativethread_signal(signum, handler)
}
void
posix_nativethread_signal(signum, handler)
int signum;
sighandler_t handler;
posix_nativethread_signal(int signum, sighandler_t handler)
{
ruby_nativethread_signal(signum, handler);
}
@ -445,7 +437,6 @@ sigsend_to_ruby_thread(int sig)
}
#endif
static RETSIGTYPE sighandler(int);
static RETSIGTYPE
sighandler(int sig)
{
@ -707,8 +698,7 @@ trap(struct trap_arg *arg)
#ifndef _WIN32
static VALUE
trap_ensure(arg)
struct trap_arg *arg;
trap_ensure(struct trap_arg *arg)
{
/* enable interrupt */
#ifdef HAVE_SIGPROCMASK