summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/process.c b/process.c
index e569ef5f6e..1d345fafa5 100644
--- a/process.c
+++ b/process.c
@@ -195,10 +195,11 @@ rb_f_waitpid(obj, vpid, vflags)
int pid, flags, status;
if (NIL_P(vflags)) flags = 0;
- else flags = FIX2UINT(vflags);
+ else flags = NUM2UINT(vflags);
- if ((pid = rb_waitpid(FIX2UINT(vpid), flags, &status)) < 0)
+ if ((pid = rb_waitpid(NUM2INT(vpid), flags, &status)) < 0)
rb_sys_fail(0);
+ if (pid == 0) return Qnil;
return INT2FIX(pid);
}