summaryrefslogtreecommitdiff
path: root/eval.c
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 /eval.c
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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 52ad4295c8..692d967fa8 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;
}