diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-16 06:37:12 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-16 06:37:12 +0000 |
commit | a94679135080615136be4d83a66b3f964b8d66a4 (patch) | |
tree | b2963b59c8b2377f5c551039abf985092167dc17 | |
parent | 62fda90d7adf5436d15f9407bed294bd5a4885be (diff) |
1.1b9_03 pre2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | io.c | 9 | ||||
-rw-r--r-- | range.c | 3 | ||||
-rw-r--r-- | sig.h | 2 | ||||
-rw-r--r-- | signal.c | 19 |
6 files changed, 44 insertions, 5 deletions
@@ -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> @@ -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 */ } @@ -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 @@ -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); } @@ -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__) @@ -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; |