summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pty/pty.c')
-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);