Issue #2642 has been updated by Makoto Kishimoto.

Status changed from Closed to Open
Target version set to 1.9.x

?????修正以????PTY.check ??第??????????????????対象??????????
??????????????????????????????? ChildExited ??????????????????????????
????????????????
----------------------------------------
Bug #2642: PTY.check is broken
http://redmine.ruby-lang.org/issues/2642

Author: Nobuyoshi Nakada
Status: Open
Priority: Low
Assignee: 
Category: 
Target version: 1.9.x


=begin
 ??????????????
 
 PTY.check????????????????????????????????????????????????????
 
 * r20298?????????? PTY.check(pid) to poll program termination. ???
   ????????????????????????????????
 * ?????????????????int status??????????????
 * pid_t?????????????raise_from_check()???VALUE???渡?????????
 
 
Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 26395) +++ ext/pty/pty.c (working copy) @@ -606,9 +606,9 @@ pty_check(int argc, VALUE *argv, VALUE s 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 */ }
-- --- ??????????Bug???????? --- ?????????????Bug??????????? 中?? 伸?? =end -- http://redmine.ruby-lang.org