summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 9 insertions, 3 deletions
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