summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-18 04:52:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-18 04:52:59 +0000
commit31345380ac41f8b830104ea41b4b52e1e2b094a8 (patch)
tree4909d877b8488439f469ef3c32ff3716cd8546ee
parent8adc4541ff4fa7caa2fbd3c006465305e21e336a (diff)
* eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
in at_exit blocks. [ruby-core:11263] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 917f5534a21..f9b8bdacb4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun 18 13:54:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
+ in at_exit blocks. [ruby-core:11263]
+
Mon Jun 18 02:49:16 2007 Koichi Sasada <ko1@atdot.net>
* vm.c (env_mark): fix to mark block.proc.
diff --git a/eval.c b/eval.c
index 52ad4295c81..692d967fa88 100644
--- a/eval.c
+++ b/eval.c
@@ -191,7 +191,21 @@ ruby_cleanup(int ex)
VALUE sig = rb_iv_get(err, "signo");
ruby_default_signal(NUM2INT(sig));
}
+ else if (ex == 0) {
+ ex = 1;
+ }
+ }
+
+#if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1
+ switch (ex) {
+#if EXIT_SUCCESS != 0
+ case 0: return EXIT_SUCCESS;
+#endif
+#if EXIT_FAILURE != 1
+ case 1: return EXIT_FAILURE;
+#endif
}
+#endif
return ex;
}