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

1.1b9_03 pre2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1998-03-16 06:37:12 +00:00
parent 62fda90d7a
commit a946791350
6 changed files with 44 additions and 5 deletions

View file

@ -1,12 +1,22 @@
Mon Mar 16 14:11:06 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* class.c (ins_methods_i): needed to consider NOEX_UNDEF.
Mon Mar 16 13:23:53 1998 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
* io.c (io_check_closed): check for `fptr->f2 == NULL'.
* io.c (io_fptr_close): ditto.
Mon Mar 16 14:11:06 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
Mon Mar 16 11:49:25 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* class.c (ins_methods_i): needed to consider NOEX_UNDEF.
* io.c (pipe_atexit): free()ing referencing pipe_list.
* range.c (range_length): returns zero, if the first is greater
than the last.
* signal.c (trap_restore_mask): restore signal mask before raising
exceptions and throws.
Fri Mar 13 13:49:24 1998 Yukihiro Matsumoto <matz@netlab.co.jp>

2
eval.c
View file

@ -2622,6 +2622,7 @@ rb_longjmp(tag, mesg, at)
str_freeze(errinfo);
}
trap_restore_mask();
JUMP_TAG(tag);
}
@ -6156,6 +6157,7 @@ f_throw(argc, argv)
if (!tt) {
NameError("uncaught throw `%s'", rb_id2name(t));
}
trap_restore_mask();
JUMP_TAG(TAG_THROW);
/* not reached */
}

9
io.c
View file

@ -886,7 +886,7 @@ rb_fdopen(fd, mode)
return f;
}
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__) || 1
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__)
static struct pipe_list {
OpenFile *fptr;
struct pipe_list *next;
@ -913,6 +913,7 @@ pipe_del_fptr(fptr)
if (list->fptr == fptr) {
pipe_list = list->next;
free(list);
return;
}
@ -931,10 +932,12 @@ static void
pipe_atexit()
{
struct pipe_list *list = pipe_list;
struct pipe_list *tmp;
while (list) {
tmp = list->next;
io_fptr_finalize(list->fptr);
list = list->next;
list = tmp;
}
}
@ -2500,7 +2503,7 @@ Init_IO()
rb_define_virtual_variable("$-i", opt_i_get, opt_i_set);
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__) || 1
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__)
atexit(pipe_atexit);
#endif

View file

@ -190,6 +190,9 @@ range_length(rng)
first = rb_iv_get(rng, "first");
last = rb_iv_get(rng, "last");
if (RTEST(rb_funcall(first, '>', 1, last))) {
return INT2FIX(0);
}
if (!obj_is_kind_of(first, cNumeric)) {
return enum_length(rng);
}

2
sig.h
View file

@ -20,6 +20,8 @@ extern int prohibit_interrupt;
#define ENABLE_INTS {prohibit_interrupt--;}
extern int trap_pending;
void trap_restore_mask _((void));
#ifdef THREAD
extern int thread_critical;
#if defined(HAVE_SETITIMER) && !defined(__BOW__)

View file

@ -358,6 +358,12 @@ struct trap_arg {
VALUE sig, cmd;
};
# ifdef HAVE_SIGPROCMASK
static sigset_t trap_last_mask;
# else
static int trap_last_mask;
# endif
static RETSIGTYPE
sigexit()
{
@ -476,9 +482,22 @@ trap_ensure(arg)
#else
sigsetmask(arg->mask);
#endif
trap_last_mask = arg->mask;
}
#endif
void
trap_restore_mask()
{
#ifndef NT
# ifdef HAVE_SIGPROCMASK
sigprocmask(SIG_SETMASK, &trap_last_mask, NULL);
# else
sigsetmask(trap_last_mask);
# endif
#endif
}
static VALUE
f_trap(argc, argv)
int argc;