summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-16 06:37:12 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-16 06:37:12 +0000
commita94679135080615136be4d83a66b3f964b8d66a4 (patch)
treeb2963b59c8b2377f5c551039abf985092167dc17
parent62fda90d7adf5436d15f9407bed294bd5a4885be (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--ChangeLog14
-rw-r--r--eval.c2
-rw-r--r--io.c9
-rw-r--r--range.c3
-rw-r--r--sig.h2
-rw-r--r--signal.c19
6 files changed, 44 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 6443744..1915ac4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/eval.c b/eval.c
index a0efea2..5f053ab 100644
--- a/eval.c
+++ b/eval.c
@@ -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 */
}
diff --git a/io.c b/io.c
index 7c08697..9f6e05b 100644
--- a/io.c
+++ b/io.c
@@ -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
diff --git a/range.c b/range.c
index 74ac972..fc5ae36 100644
--- a/range.c
+++ b/range.c
@@ -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);
}
diff --git a/sig.h b/sig.h
index ac4a478..24a5160 100644
--- a/sig.h
+++ b/sig.h
@@ -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__)
diff --git a/signal.c b/signal.c
index e5621b4..f518d59 100644
--- a/signal.c
+++ b/signal.c
@@ -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;