diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 08:47:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 08:47:04 +0000 |
commit | b1489489826fa6fee533ee9344736766410daabd (patch) | |
tree | 2b6cb6b4e19953401b6e836b94a04db33d539c96 /ext/pty/pty.c | |
parent | ccf67667b8e07471a3463394574944f78c1adf7b (diff) | |
download | ruby-b1489489826fa6fee533ee9344736766410daabd.tar.gz |
* ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and
call raise_from_check() with pid_t. [ruby-dev:40141]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r-- | ext/pty/pty.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 */ } |