summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
commit96b40dff450df701200ea5edceb07f2ed847e3fd (patch)
treea2c90999001ebcb8fd2fd67ffb3d5911a8e98f81 /process.c
parent7dd3853eac98396d3b5abee16d7f680d941eae82 (diff)
2000-02-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/process.c b/process.c
index f68753b..38c72f5 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);