diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-18 04:52:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-18 04:52:59 +0000 |
commit | 31345380ac41f8b830104ea41b4b52e1e2b094a8 (patch) | |
tree | 4909d877b8488439f469ef3c32ff3716cd8546ee /eval.c | |
parent | 8adc4541ff4fa7caa2fbd3c006465305e21e336a (diff) | |
download | ruby-31345380ac41f8b830104ea41b4b52e1e2b094a8.tar.gz |
* 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.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; } |