From e83d532ff8b7d3c6eeaee3931d8b00df19c5f538 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 17 Feb 2000 07:11:22 +0000 Subject: 2000-02-17 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index f68753b1e..38c72f5a6 100644 --- a/process.c +++ b/process.c @@ -160,7 +160,7 @@ wait_each(key, value, data) #endif static VALUE -rb_f_wait() +proc_wait() { int pid, state; #ifdef NO_WAITPID @@ -189,16 +189,17 @@ rb_f_wait() } static VALUE -rb_f_waitpid(obj, vpid, vflags) +proc_waitpid(obj, vpid, vflags) VALUE 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); } @@ -1056,8 +1057,8 @@ Init_process() rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1); #endif #ifndef NT - rb_define_module_function(rb_mProcess, "wait", rb_f_wait, 0); - rb_define_module_function(rb_mProcess, "waitpid", rb_f_waitpid, 2); + rb_define_module_function(rb_mProcess, "wait", proc_wait, 0); + rb_define_module_function(rb_mProcess, "waitpid", proc_waitpid, 2); #ifndef USE_CWGUSI rb_define_module_function(rb_mProcess, "pid", get_pid, 0); -- cgit