summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-03 01:00:23 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-03 01:00:23 +0000
commit6bdde0e5e612befe47c0a4e87f4900dbb106f78e (patch)
tree57a32461394f61f9442dccb1f052d141efd5a99e /ext
parent9e736114eb489293a3708d04efed3cb492de6f92 (diff)
merge revision(s) 33468:
* ext/pty/pty.c (pty_check): should return nil until the child terminates or stops. [ruby-dev:44600] [Bug #2642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/pty/pty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 3797972975..b18eb68f77 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -658,7 +658,7 @@ pty_check(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "11", &pid, &exc);
cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED);
- if (cpid == -1) return Qnil;
+ if (cpid == -1 || cpid == 0) return Qnil;
if (!RTEST(exc)) return rb_last_status_get();
raise_from_check(cpid, status);