diff --git a/ChangeLog b/ChangeLog index 143c490974..3a0c85eddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 25 17:47:02 2010 Nobuyoshi Nakada + + * ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and + call raise_from_check() with pid_t. [ruby-dev:40141] + Mon Jan 25 17:36:11 2010 Nobuyoshi Nakada * version.c (RUBY_LIB, RUBY_*_LIB): moved from configures. diff --git a/ext/pty/pty.c b/ext/pty/pty.c index b4394c207c..a94d2f249f 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -605,11 +605,11 @@ pty_check(int argc, VALUE *argv, VALUE self) int status; rb_scan_args(argc, argv, "11", &pid, &exc); - cpid = rb_waitpid(NUM2PIDT(pid), &status, WUNTRACED); + cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED); if (cpid == -1) return Qnil; - if (!RTEST(exc)) return status; - raise_from_check(pid, status); + if (!RTEST(exc)) return rb_last_status_get(); + raise_from_check(cpid, status); return Qnil; /* not reached */ }