mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* process.c (Init_process): Process::Status#to_int removed.
(PST2INT): defined. (pst_to_s): use PST2INT. (pst_inspect): ditto. (pst_equal): ditto. (pst_bitand): ditto. (pst_rshift): ditto. (pst_wifstopped): ditto. (pst_wstopsig): ditto. (pst_wifsignaled): ditto. (pst_wtermsig): ditto. (pst_wifexited): ditto. (pst_wexitstatus): ditto. (pst_success_p): ditto. (pst_wcoredump): ditto. (rb_f_system): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e1a45b10b6
commit
7ba5c4e83b
2 changed files with 33 additions and 14 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
|||
Fri Jun 20 16:34:14 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (Init_process): Process::Status#to_int removed.
|
||||
(PST2INT): defined.
|
||||
(pst_to_s): use PST2INT.
|
||||
(pst_inspect): ditto.
|
||||
(pst_equal): ditto.
|
||||
(pst_bitand): ditto.
|
||||
(pst_rshift): ditto.
|
||||
(pst_wifstopped): ditto.
|
||||
(pst_wstopsig): ditto.
|
||||
(pst_wifsignaled): ditto.
|
||||
(pst_wtermsig): ditto.
|
||||
(pst_wifexited): ditto.
|
||||
(pst_wexitstatus): ditto.
|
||||
(pst_success_p): ditto.
|
||||
(pst_wcoredump): ditto.
|
||||
(rb_f_system): ditto.
|
||||
|
||||
Fri Jun 20 15:40:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_store, rb_ary_splice): not depend on unspecified
|
||||
|
|
28
process.c
28
process.c
|
@ -260,6 +260,7 @@ pst_to_i(VALUE st)
|
|||
return rb_iv_get(st, "status");
|
||||
}
|
||||
|
||||
#define PST2INT(st) NUM2INT(pst_to_i(st))
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
@ -333,7 +334,7 @@ pst_to_s(VALUE st)
|
|||
VALUE str;
|
||||
|
||||
pid = NUM2LONG(pst_pid(st));
|
||||
status = NUM2INT(pst_to_i(st));
|
||||
status = PST2INT(st);
|
||||
|
||||
str = rb_str_buf_new(0);
|
||||
pst_message(str, pid, status);
|
||||
|
@ -356,7 +357,7 @@ pst_inspect(VALUE st)
|
|||
VALUE str;
|
||||
|
||||
pid = NUM2LONG(pst_pid(st));
|
||||
status = NUM2INT(pst_to_i(st));
|
||||
status = PST2INT(st);
|
||||
|
||||
str = rb_sprintf("#<%s: ", rb_class2name(CLASS_OF(st)));
|
||||
pst_message(str, pid, status);
|
||||
|
@ -396,7 +397,7 @@ pst_equal(VALUE st1, VALUE st2)
|
|||
static VALUE
|
||||
pst_bitand(VALUE st1, VALUE st2)
|
||||
{
|
||||
int status = NUM2INT(st1) & NUM2INT(st2);
|
||||
int status = PST2INT(st1) & NUM2INT(st2);
|
||||
|
||||
return INT2NUM(status);
|
||||
}
|
||||
|
@ -417,7 +418,7 @@ pst_bitand(VALUE st1, VALUE st2)
|
|||
static VALUE
|
||||
pst_rshift(VALUE st1, VALUE st2)
|
||||
{
|
||||
int status = NUM2INT(st1) >> NUM2INT(st2);
|
||||
int status = PST2INT(st1) >> NUM2INT(st2);
|
||||
|
||||
return INT2NUM(status);
|
||||
}
|
||||
|
@ -435,7 +436,7 @@ pst_rshift(VALUE st1, VALUE st2)
|
|||
static VALUE
|
||||
pst_wifstopped(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFSTOPPED(status))
|
||||
return Qtrue;
|
||||
|
@ -455,7 +456,7 @@ pst_wifstopped(VALUE st)
|
|||
static VALUE
|
||||
pst_wstopsig(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFSTOPPED(status))
|
||||
return INT2NUM(WSTOPSIG(status));
|
||||
|
@ -474,7 +475,7 @@ pst_wstopsig(VALUE st)
|
|||
static VALUE
|
||||
pst_wifsignaled(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFSIGNALED(status))
|
||||
return Qtrue;
|
||||
|
@ -495,7 +496,7 @@ pst_wifsignaled(VALUE st)
|
|||
static VALUE
|
||||
pst_wtermsig(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFSIGNALED(status))
|
||||
return INT2NUM(WTERMSIG(status));
|
||||
|
@ -515,7 +516,7 @@ pst_wtermsig(VALUE st)
|
|||
static VALUE
|
||||
pst_wifexited(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFEXITED(status))
|
||||
return Qtrue;
|
||||
|
@ -546,7 +547,7 @@ pst_wifexited(VALUE st)
|
|||
static VALUE
|
||||
pst_wexitstatus(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WIFEXITED(status))
|
||||
return INT2NUM(WEXITSTATUS(status));
|
||||
|
@ -565,7 +566,7 @@ pst_wexitstatus(VALUE st)
|
|||
static VALUE
|
||||
pst_success_p(VALUE st)
|
||||
{
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (!WIFEXITED(status))
|
||||
return Qnil;
|
||||
|
@ -585,7 +586,7 @@ static VALUE
|
|||
pst_wcoredump(VALUE st)
|
||||
{
|
||||
#ifdef WCOREDUMP
|
||||
int status = NUM2INT(st);
|
||||
int status = PST2INT(st);
|
||||
|
||||
if (WCOREDUMP(status))
|
||||
return Qtrue;
|
||||
|
@ -2766,7 +2767,7 @@ rb_f_system(int argc, VALUE *argv)
|
|||
if (status < 0) {
|
||||
return Qnil;
|
||||
}
|
||||
status = NUM2INT(rb_last_status_get());
|
||||
status = PST2INT(rb_last_status_get());
|
||||
if (status == EXIT_SUCCESS) return Qtrue;
|
||||
return Qfalse;
|
||||
}
|
||||
|
@ -5118,7 +5119,6 @@ Init_process(void)
|
|||
rb_define_method(rb_cProcessStatus, "&", pst_bitand, 1);
|
||||
rb_define_method(rb_cProcessStatus, ">>", pst_rshift, 1);
|
||||
rb_define_method(rb_cProcessStatus, "to_i", pst_to_i, 0);
|
||||
rb_define_method(rb_cProcessStatus, "to_int", pst_to_i, 0);
|
||||
rb_define_method(rb_cProcessStatus, "to_s", pst_to_s, 0);
|
||||
rb_define_method(rb_cProcessStatus, "inspect", pst_inspect, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue