* error.c (exit_success_p): Check status code more carefully.
status code may have garbage in upper bit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8f6c729601
commit
7503f19346
@ -1,3 +1,8 @@
|
|||||||
|
Tue Dec 21 00:22:44 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* error.c (exit_success_p): Check status code more carefully.
|
||||||
|
status code may have garbage in upper bit.
|
||||||
|
|
||||||
Mon Dec 20 23:12:37 2010 Tanaka Akira <akr@fsij.org>
|
Mon Dec 20 23:12:37 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* node.c: parenthesize macro arguments.
|
* node.c: parenthesize macro arguments.
|
||||||
|
12
error.c
12
error.c
@ -710,9 +710,15 @@ exit_status(VALUE exc)
|
|||||||
static VALUE
|
static VALUE
|
||||||
exit_success_p(VALUE exc)
|
exit_success_p(VALUE exc)
|
||||||
{
|
{
|
||||||
VALUE status = rb_attr_get(exc, rb_intern("status"));
|
VALUE status_val = rb_attr_get(exc, rb_intern("status"));
|
||||||
if (NIL_P(status)) return Qtrue;
|
int status;
|
||||||
if (status == INT2FIX(EXIT_SUCCESS)) return Qtrue;
|
|
||||||
|
if (NIL_P(status_val))
|
||||||
|
return Qtrue;
|
||||||
|
status = NUM2INT(status_val);
|
||||||
|
if (WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS)
|
||||||
|
return Qtrue;
|
||||||
|
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user