From f1fdbf080efdf954a4773baf2dd088eddb7c03ef Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 21 Nov 2001 15:42:12 +0000 Subject: * parse.y (str_extend): should check nesting parentheses in #{}. * process.c (pst_wstopsig): returns nil unless WIFSTOPPED() is non-zero. * process.c (pst_wtermsig): returns nil unless WIFSIGNALED() is non-zero. * process.c (pst_wexitstatus): returns nil unless WIFEXITED() is non-zero. * eval.c (rb_thread_select): tv_sec and tv_usec should not be negative. * signal.c (posix_signal): do not set SA_RESTART for SIGVTALRM. * parse.y (call_args2): block_arg may follow the first argument in call_args2. * eval.c (stack_check): should avoid stack length check during raising SystemStackError exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index a72f003064..81685d0c1d 100644 --- a/process.c +++ b/process.c @@ -161,7 +161,9 @@ pst_wstopsig(st) { int status = NUM2INT(st); - return INT2NUM(WSTOPSIG(status)); + if (WIFSTOPPED(status)) + return INT2NUM(WSTOPSIG(status)); + return Qnil; } static VALUE @@ -182,7 +184,9 @@ pst_wtermsig(st) { int status = NUM2INT(st); - return INT2NUM(WTERMSIG(status)); + if (WIFSIGNALED(status)) + return INT2NUM(WTERMSIG(status)); + return Qnil; } static VALUE @@ -203,7 +207,9 @@ pst_wexitstatus(st) { int status = NUM2INT(st); - return INT2NUM(WEXITSTATUS(status)); + if (WIFEXITED(status)) + return INT2NUM(WEXITSTATUS(status)); + return Qnil; } static VALUE -- cgit v1.2.3